Top 50 Most-Used Linux & Windows Commands
Linux Commands
Command | Description | Syntax |
---|---|---|
ls | Lists files and directories. | ls [options] [directory] |
cd | Changes the current directory. | cd [directory] |
pwd | Displays the current directory path. | pwd |
mkdir | Creates a new directory. | mkdir [directory] |
rmdir | Removes an empty directory. | rmdir [directory] |
rm | Removes files or directories. | rm [options] [file/directory] |
cp | Copies files or directories. | cp [options] source destination |
mv | Moves or renames files or directories. | mv [source] [destination] |
touch | Creates an empty file or updates the timestamp. | touch [file] |
cat | Displays the contents of a file. | cat [file] |
less | Views the contents of a file one screen at a time. | less [file] |
head | Displays the first few lines of a file. | head [file] |
tail | Displays the last few lines of a file. | tail [file] |
echo | Outputs text to the terminal. | echo [text] |
chmod | Changes file permissions. | chmod [permissions] [file] |
chown | Changes file owner and group. | chown [owner]:[group] [file] |
find | Searches for files and directories. | find [path] [options] |
grep | Searches text within files. | grep [options] [pattern] [file] |
man | Displays the manual for a command. | man [command] |
df | Displays disk space usage. | df [options] |
du | Displays directory space usage. | du [options] [directory] |
top | Displays running processes. | top |
ps | Displays current processes. | ps [options] |
kill | Terminates a process by PID. | kill [PID] |
pkill | Terminates processes by name. | pkill [process_name] |
wget | Downloads files from the web. | wget [URL] |
curl | Transfers data from or to a server. | curl [options] [URL] |
ssh | Connects to a remote server via SSH. | ssh [user]@[host] |
scp | Securely copies files between hosts. | scp [source] [destination] |
nano | Opens a text editor. | nano [file] |
vim | Opens a powerful text editor. | vim [file] |
tar | Archives files. | tar [options] [archive_file] [file/directory] |
zip | Compresses files into a zip archive. | zip [options] [archive_file] [file/directory] |
unzip | Extracts files from a zip archive. | unzip [archive_file] |
alias | Creates an alias for a command. | alias [name]='[command]' |
unalias | Removes an alias. | unalias [name] |
history | Shows command history. | history |
clear | Clears the terminal screen. | clear |
reboot | Reboots the system. | reboot |
shutdown | Shuts down the system. | shutdown [options] |
ping | Checks connectivity to a host. | ping [host] |
hostname | Displays or sets the system's hostname. | hostname [name] |
ifconfig | Configures network interfaces. | ifconfig [interface] |
netstat | Displays network connections. | netstat [options] |
iptables | Manages firewall rules. | iptables [options] |
service | Manages system services. | service [service_name] [command] |
systemctl | Controls the systemd system and service manager. | systemctl [command] [service_name] |
df | Displays disk space usage. | df [options] |
mount | Mounts file systems. | mount [options] [device] [directory] |
umount | Unmounts file systems. | umount [device] |
Windows Commands
Command | Description | Syntax |
---|---|---|
dir | Lists files and directories in the current directory. | dir [options] [directory] |
cd | Changes the current directory. | cd [directory] |
md /mkdir | Creates a new directory. | md [directory] |
rd /rmdir | Removes an empty directory. | rd [directory] |
del | Deletes files. | del [file] |
copy | Copies files from one location to another. | copy [source] [destination] |
move | Moves files from one location to another. | move [source] [destination] |
ren /rename | Renames a file or directory. | ren [old_name] [new_name] |
type | Displays the contents of a file. | type [file] |
cls | Clears the Command Prompt screen. | cls |
echo | Displays a message or turns command echoing on or off. | echo [message] |
attrib | Displays or changes file attributes. | attrib [options] [file] |
chkdsk | Checks a disk and displays a status report. | chkdsk [options] [drive:] |
tasklist | Displays a list of currently running processes. | tasklist |
taskkill | Terminates a running process. | taskkill [options] |
ipconfig | Displays network configuration information. | ipconfig [options] |
ping | Tests network connectivity. | ping [host] |
hostname | Displays the computer's hostname. | hostname |
netstat | Displays network connections, routing tables, and interface statistics. | netstat [options] |
nslookup | Queries the DNS to obtain domain name or IP address mapping. | nslookup [hostname] |
tracert | Traces the route to a network host. | tracert [host] |
netsh | Configures network interfaces, firewall settings, and more. | netsh [command] |
format | Formats a disk for use with Windows. | format [options] [drive:] |
shutdown | Shuts down or restarts the computer. | shutdown [options] |
regedit | Opens the Windows Registry Editor. | regedit |
msconfig | Opens the System Configuration utility. | msconfig |
sfc | Scans and repairs system files. | sfc [options] |
diskpart | Manages disk partitions. | diskpart |
wmic | Displays WMI information inside an interactive command shell. | wmic [alias] [command] |
systeminfo | Displays detailed system information. | systeminfo |
gpupdate | Updates Group Policy settings. | gpupdate [options] |
gpresult | Displays Group Policy settings and resultant set of policy (RSoP) for a user or computer. | gpresult [options] |
bcdedit | Manages Boot Configuration Data. | bcdedit [options] |
cipher | Displays or alters the encryption of directories [files] on NTFS partitions. | cipher [options] [directory] |
powercfg | Manages power settings. | powercfg [options] |
driverquery | Displays a list of all installed device drivers and their properties. | driverquery [options] |
schtasks | Manages scheduled tasks. | schtasks [options] |
net | Manages network resources. | net [command] |
assoc | Displays or modifies file extension associations. | assoc [file_extension]=[file_type] |
ftype | Displays or modifies file types used in file extension associations. | ftype [file_type]=[command_string] |
path | Displays or sets a search path for executable files. | path [options] |
where | Locates and displays files in directories in a command prompt. | where [options] [file_name] |
doskey | Edits command lines, recalls Windows commands, and creates macros. | doskey [options] |
prompt | Changes the Windows Command Prompt. | prompt [text] |
title | Sets the window title for the Command Prompt. | title [text] |
cls | Clears the Command Prompt screen. | cls |
pause | Pauses the execution of a batch file and shows a message. | pause |
set | Displays, sets, or removes environment variables. | set [variable]=[value] |
ver | Displays the Windows version number. | ver |
exit | Closes the Command Prompt. | exit |
Top comments (0)