Unix Commands

  1. Clear screen: $clear
  2. Show current date and time: $date
  3. To print current working directory: $pwd
  4. To list files and directory: $ls
  5. To make a new directory: $mkdir directory_name
  6. To navigate to directory directory_name: $cd directory_name
  7. To create a new file(not a directory) called README.txt: $touch README.txt
  8. To copy a file from directory d1 to directory d2: $cp /home/d1/README.txt /home/d2/
  9. To move a file from directory d1 to directory d2: $mv /home/d1/README.txt /home/d2/
  10. To search an input in a file say README.txt: $grep search_term README.txt
  11. To list file with detailed information: $ls -l
  12. To list all files in a directory including filename starting with .(dot): $ls -a
  13. To remove a file: $rm filename
  14. To change into user’s directory: $cd ~userid