why important
play

Why important ? You must know how to: Create a file Create a - PowerPoint PPT Presentation

Why important ? You must know how to: Create a file Create a folder Delete a file Delete a folder Show current Path Navigate through folders Show content in folder Show content in file Copy


  1. Why important ? ● You must know how to: ○ Create a file ○ Create a folder ○ Delete a file ○ Delete a folder ○ Show current Path ○ Navigate through folders ○ Show content in folder ○ Show content in file ○ Copy a File/Folder ○ Compile a C program ○ Execute a C program

  2. First of all, open the linux Terminal Command: Ctrl + Alt + T

  3. In the Linux Terminal, Type: touch name_of_file.extension Examples: ● touch hello.txt ● touch cs256.pdf ● touch code.c

  4. In the Linux Terminal, Type: mkdir name_of_folder Examples: ● mkdir home ● mkdir CS

  5. In the Linux Terminal, Type: rm name_of_file.extension Examples: ● rm hello.txt ● rm cs256.pdf ● rm code.c

  6. In the Linux Terminal, Type: rm -rf name_of_file.extension Examples: ● rm -rf home ● rm -rf CS

  7. In the Linux Terminal, Type: pwd

  8. In the Linux Terminal, Type: ● To navigate ○ cd path_of_folder ● To return to previous folder ○ cd .. ● To return to main page(Desktop) ○ cd Examples: ● cd Desktop/Download ( To go to the Downloads folder) ● cd ..

  9. In the Linux Terminal, Type: ● For folder ○ ls or ls name_of_folder ● For file ○ cat name_of_file Examples: ● ls Desktop ● cat hello.txt

  10. Command: → ~ means home directory . means current directory ● File ○ cp src dest ● Folder ○ cp -r src dest Examples: ● File: ○ cp /u1/junk/shakespeare.txt ~ ● Folder ○ cp -r /u1/junk/MST .

  11. In the Linux Terminal, Type: gcc name_of_file.extension Examples: ● gcc test.c

  12. In the Linux Terminal, Type: ./a.out

  13. ● Create a folder named cs256_linux ● Go to cs256_linux folder ● Create a file named my_file.txt ● Copy the content of file from “/u1/junk/shakespeare.txt“ to your my_file.txt ● Show the content of the file ● Delete the file my_file.txt ● Copy folder from “/u1/junk/MST” to your cs256_linux folder ● Delete the folder cs256_linux

Recommend


More recommend