Tribhuwan University
Triyuga Janata Multiple Campus
Triyuga-03 Gaighat Udayapur
System Administrator with Linux
(ICT Ed.486)
Submitted By:
Asna Rai
B.Ed ICT(8th Semester)
Roll No: 76224005
Internal: External
Sharvin Mishra ……………….
(Lecture)
50 Linux Commands and Their Uses
1. ls
Use: Lists files and directories.
Example: ls -l (detailed list with permissions).
2. cd
Use: Changes the current directory.
Example: cd /home/user (change to the /home/user directory).
3. pwd
Use: Displays the current working directory.
Example: pwd
4. mkdir
Use: Creates a new directory.
Example: mkdir new_folder
5. rmdir
Use: Removes an empty directory.
Example: rmdir empty_folder
6. rm
Use: Deletes files or directories.
Example: rm file.txt (delete a file).
7. cp
Use: Copies files or directories.
Example: cp file1.txt file2.txt
8. mv
Use: Moves or renames files/directories.
Example: mv oldname.txt newname.txt
9. touch
Use: Creates an empty file.
Example: touch newfile.txt
10. cat
Use: Displays the content of a file.
Example: cat file.txt
11. head
Use: Shows the first lines of a file.
Example: head -n 5 file.txt
12. tail
Use: Shows the last lines of a file.
Example: tail -n 5 file.txt
13. echo
Use: Prints text to the terminal or file.
Example: echo "Hello, World!" > file.txt
14. chmod
Use: Changes file permissions.
Example: chmod 755 script.sh
15. chown
Use: Changes file owner.
Example: chown user:group file.txt
16. find
Use: Searches for files and directories.
Example: find / -name "file.txt"
17. locate
Use: Quickly finds files using an index.
Example: locate file.txt
18. grep
Use: Searches for patterns in a file.
Example: grep "keyword" file.txt
19. wc
Use: Counts lines, words, and characters in a file.
Example: wc -l file.txt
20. sort
Use: Sorts lines in a file.
Example: sort file.txt
21. uniq
Use: Removes duplicate lines from sorted data.
Example: sort file.txt | uniq
22. diff
Use: Compares two files line by line.
Example: diff file1.txt file2.txt
23. tar
Use: Archives files into a tarball.
Example: tar -cvf archive.tar folder/
24. gzip
Use: Compresses files using gzip.
Example: gzip file.txt
25. gunzip
Use: Decompresses gzip files.
Example: gunzip file.txt.gz
26. zip
Use: Compresses files into a zip archive.
Example: zip archive.zip file1 file2
27. unzip
Use: Extracts files from a zip archive.
Example: unzip archive.zip
28. df
Use: Shows disk space usage.
Example: df -h
29. du
Use: Displays directory/file size.
Example: du -sh folder/
30. ps
Use: Lists running processes.
Example: ps aux
31. top
Use: Displays real-time system resource usage.
Example: top
32. kill
Use: Terminates a process by PID.
Example: kill 1234
33. ssh
Use: Connects to a remote system securely.
Example: ssh user@host
34. scp
Use: Copies files between systems securely.
Example: scp file.txt user@host:/path
35. wget
Use: Downloads files from the web.
Example: wget https://example.com/file.txt
36. curl
Use: Transfers data from/to a server.
Example: curl -O https://example.com/file.txt
37. nano
Use: Opens a simple text editor.
Example: nano file.txt
38. vim
Use: Opens the Vim text editor.
Example: vim file.txt
39. man
Use: Displays the manual for a command.
Example: man ls
40. history
Use: Shows previously executed commands.
Example: history
41. alias
Use: Creates command shortcuts.
Example: alias ll='ls -la'
42. uname
Use: Displays system information.
Example: uname -a
43. whoami
Use: Prints the current logged-in user.
Example: whoami
44. uptime
Use: Shows system uptime.
Example: uptime
45. date
Use: Displays or sets the system date/time.
Example: date
46. cal
Use: Displays a calendar.
Example: cal
47. ping
Use: Checks network connectivity.
Example: ping google.com
48. netstat
Use: Displays network connections and statistics.
Example: netstat –an
49. ifconfig
Use: Configures network interfaces.
Example: ifconfig eth0
50. iptables
Use: Configures firewall rules.
Example: iptables -L