| info |
Shows online information about a command |
$ info uname |
| man |
Shows details (manual) of a command |
$ man uname |
| whatis |
Shows a short description of a specific keyword |
$ whatis uname |
| type |
Shows the location of a command file |
$ type uname |
| alias |
Assign a command alias – especially useful for long commands |
$ alias t=type $ t uname $ alias |
| unalias |
Remove command alias |
$ unalias t |
| pwd |
Displays the current directory |
$ pwd |
| ln |
Create links to files and directories |
$ ln -s [file] [soft-link-to-file] $ ln -s info.txt newinfo.txt |
| touch |
To trigger a file stamp update for a file |
$ touch info.txt |
| find |
Search for a file based on the name |
$ find [dir-path] -name [filename] $ find . -name info.jpeg |
| whereis |
Search for executable files |
$ whereis uname |
| which |
Search for files in the directories part of the PATH variable |
$ which uname |
| dd |
Copy lines of data |
$ dd conv=ucase Type Hello world ctrl+d $ echo “hello world > info.txt $ dd if=info.txt of=newinfo.txt conv=ucase $ cat newinfo.txt |
| diff |
Display the results of comparing two files |
$ echo “hello world > info.txt $ echo “hello world > info1.txt $ diff info.txt info1.txt -s $ echo “hello world123 > newinfo.txt $ diff info.txt newinfo.txt -s |
| more |
Show a text file one page at a time – display can only go forward |
$ ls -R > info.txt $ more info.txt $ ls -R | more |
| less |
Show a text file one page at a time – display can only go forward and backwards |
$ less info.txt $ ls -R | less |
| wc |
Display the count of the number of characters, words, and lines in a file |
$ wc info.txt |
| cut |
Get sections of text in a file |
$ cut -b 1 info.txt $ cut -b 1-3 info.txt $ cut -b 1,3 info.txt |
| grep |
Display results of finding expressions in a file |
$ cat info.txt | grep Desktop $ cat info.txt | grep -i desktop $ grep -i “desktop” info.txt |
| sed |
Perform editing commands, then copy to a standard output |
First occurance in every line will be changed $ dw’s/Desktop/Dashboard/’ info.txt 2nd occurance in every line will be changed $ dw ‘s/Desktop/Dashboard/2’ info.txt All occurances will be changed $ dw ‘s/Desktop/Dashboard/g’ info.txt |
| split |
Specify a size to break a file into |
$ split info.txt $ ls $ rm x* -l100 is 100 lines per file $ split -l100 info.txt $ ls |
| sort |
Arrange the lines in a file |
$ sort info.txt |
| uniq |
Keep unique lines in a file and delete duplicates |
$ echo “Hey Hi Hello Commands Linux Irc” > info.txt $ cat info.txt $ uniq info.txt $ uniq info.txt -c $ uniq info.txt -d |
| tar |
Archive files with one or more directories |
Archive the file $ tar -cf archive.tar file1 file2 Extract the files $ tar -xf archive.tar |
| cal |
Show the calendar for the specified month or year |
$ cal $ cal -3 $ cal -m 5 $ cal -y 2020 |
| date |
Show/Set the current date and time |
$ date Sets the system date and time to given date $ date -s “11/20/2003 12:48:00” |
| bg |
Run a program or a process in the background |
$ bg %[PID] |
| free |
Check for the free memory |
$free |
| kill |
Stop a process |
$ kill <PSID> |
| nice |
Run a program with a low priority, niceness values range from -20 to 19, with the former being most favorable, while latter being least |
$ nice -10 ls -R $ nice –10 ls -R |
| ps |
Show current running processes |
$ps |
| top |
Show list of CPU and memory utilization of processes |
$top |
| reboot |
Restart the system |
$reboot |
| shutdown |
Turn off system |
$shutdown |