Bash
Copy code
grep "function_name" *.c
C (GCC)
Bash
Copy code
./main
pwd – Print Working Directory
Shows your current directory path.
Bash
Copy code
Cmd
Copy code
cd
ls / dir – List Files and Folders
Lists files in the current directory.
Bash
Copy code
Cmd
Copy code
dir
cd – Change Directory
Moves between folders.
Bash
Copy code
Cmd
Copy code
cd C:\path\to\project
Mkdir
This command is used when subdirectories are to be created within the directories.
Syntax: mkdir [<drive>:]<path>
Example: mkdir fantastic ( to create a directory name “ fantastic”)
REN: Rename
Syntax: ren [<drive>:][<path>]<filename1> <filename2>
Example– ren /?
ASSOC: Fix File Associations
This is one of the most basic and most common commands. It helps to associate (as the name suggests) some file extensions to some programs. For Example- When we click on .doc (extension), the computer is able to decide that it needs to associate it with Microsoft Word. The screenshot below shows an example of how this command works.
Syntax: assoc [.ext[=[fileType]]]
FC File compare
The second most common command used is FC, also known as File Compare. This is an interesting feature that allows comparing files that have been changed over time.
Syntax: FC /a [/c] [/l] [/lb<n>] [/n] [/off[line]] [/t] [/u] [/w] [/<nnnn>] [<drive1>:][<path1>]<filename1> [<drive2>:][<path2>]<filename2>
FC/b [<drive1:>][<path1>]<filename1> [<drive2:>][<path2>]<filename2>
Example: FC File 1.txt File 2.txt
POWERCFG: Power Configuration
This command gives a report of the power settings of the computer. In situations when the power of the computer drains out quickly, this command can help to generate a complete power efficiency. The report is generated within a minute and is extremely useful to detect any warnings which may impact the performance of the system.
Syntax: powercfg /option [arguments] [/?]
Example: powercfg /?
SHUTDOWN: Turn off Computer
This command is a very resourceful command. By using this command, users can not just shut down computers but also can control the process of the shutdown. This command is popular in situations where shutdown is part of a planned task.
Users can type shutdown/i on the command prompt and choose to either restart or a complete shutdown on the GUI dialogue box that appears. Users have a choice to avoid this GUI dialogue box by typing the shutdown/s command.
Syntax: shutdown [/i | /l | /s | /sg | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/fw] [/f] [/m \\computer][/t xxx][/d
[p|u:]xx:yy [/c “comment”]]
Example: shutdown/i
SYSTEMINFO: System Information
This command helps to get system-related information like a network card, Windows OS, or details of the processor. The information provided by this command is easy to comprehend.
Syntax: systeminfo [/s <computer> [/u <domain>\<username> [/p <password>]]] [/fo {TABLE | LIST | CSV}] [/nh]
Example: C:\Users\systeminfo
SFC: System File Checker
This command helps to detect any malware or virus threat by running a scan on the core system files. In order to run this command, Administrator rights are needed. On the CMD command prompt icon, use the right-click key and select the option RUN as Administrator.
Users need to type SFC/SCANNOW to run a diagnostic check to ensure all files are safe from malware and in case of any threat of malware, these files are repaired using the backup files.
Syntax: SFC [/scannow] [/verifyonly] [/scanfile=<file>] [/verifyfile=<file>] [/offwindir=<offline windows directory> /offbootdir=<offline boot directory>]
Example: C:\Users\SFC
.NET USE: Map Drives
This command is used for mapping a new drive. Users also have an option to use File Explorer and use Map Network Drive Wizard, if a new driver needs to be mapped, however, this command makes the process quick through one string of commands.
The command syntax is– Net use (drive name)\\OTHER-COMPUTER\SHARE/persistent.yes . This is considering that \\OTHER-COMPUTER\SHARE is a shared folder on the computer and needs to be mapped to a new drive. It is important to use “persistent” here as it ensures that every time the computer is logged onto, the drive is revamped.
Syntax: Net use (drive name)\\OTHER-COMPUTER\SHARE/persistent.yes
Example: Net use /Persistent: Yes
CHKDSK: Check Disk
This command is a step ahead of the SFC command. It allows the scanning of the complete drive as against the scanning of the core system files done by the SFC command. This command needs to be run as an administrator, and the syntax is CHKDSK/f (drive name). In the below screenshot, we can see that the command could not be executed as Administrator rights were missing.
Syntax: chkdsk [<volume>[[<path>]<filename>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b]
Example: chkdsk C:
Some important parameters for this command are explained below-
Parameter /f: This parameter helps to fix any errors on the disk. In order to use this parameter, the disk must be locked.
Parameter /v: This parameter shows the name of all files in all directories as the process of checking the disk progresses.
SCHTASKS: Schedule Task
This command is another option apart from the inbuilt wizard in Windows when a schedule for tasks has to be created. Tasks can be scheduled by using the Schedule Task wizard or simply by using the command SCHTASKS.
The frequency of the tasks can be minute, hourly, daily, or monthly and can be set by the /MO command. If the command execution is successful, the following response can be seen- SUCCESS: The Scheduled Task “name of the task” has been created.
Syntax:
schtasks change
schtasks create
schtasks delete
schtasks end
schtasks query
schtasks run
Example- C :\Users\schtasks
PAGE 2