Linux Basic Commands

  1. ls = Display the files and folders in the current directory.
  2. ls -l = Shows detailed information files and directories.
  3. ls -a / ls -la = Shows all files, including hidden files.
  4. cat > filename.txt = Create a file using cat. Then type your text and Press CTRL + D to save.
  5. cat >> filename.txt = Add more data on create a file.
  6. cat filename.txt = See file data.
  7. cat > .filename.txt = It is used for create a hidden file.
  8. cat .filename.txt = See hidden file data.
  9. stat filename = It shows metadata.
  10. nano filename = It is used for modify/edit file data.
  11. touch file1 file2 file3 = Create multiple files at once.
  12. touch filename = It is used for create a empty file.
  13. mkdir directoryname = It is used for create a directory.
  14. mv filename Directoryname = Move file in directory.
  15. cp file1 file2 = Copy file1 in file2 .
  16. mkdir -p dirx/diry/dirz = Create a directory dirx under dirx in diry than under diry in dirz
  17. rm filename = It is used for remove a file.
  18. rmdir dirctoryname = It is used for remove a blank directory.
  19. rm -rf directoryname = It is used for remove a directory an under data.
  20. head filename = Its show starting to end data .
  21. tail filename = Its show end to top data .
  22. sort filename = Its show line wise data.
  23. ls -ltr = Display list files and directories with detailed information, sorted by time (oldest first).
  24. useradd name = Used for add new user.
  25. cat /etc/passwd = See new user you add.
  26. groupadd name = Used for create a group.
  27. cat /etc/passwd = See group you create.
  28. gpasswd -a user group = Used for user add in group.
  29. gpasswd -M user,user, group = Used for multiple users add in group.
  30. ln -s filename soft-link = This command used for create a dublicate file but original file will delete so data remove dublicate file.
  31. ln Database-file01 hard-link = This command used for create a dublicate file supose original file will delete but dublicate file data is saved.


To view or add a comment, sign in

Others also viewed

Explore content categories