Unix Fundamentals CS 127
File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory
Viewing files ls Typing this command in a directory gives a list of the files in that directory ls -a Displays all hidden files ls -al Lists all files including hidden files and the properties of those files
Top 10 Unix commands 1.ls lists files and directories 2.cp original_file copied_file copies the original file from one location to another 3.mv original_file new_file Moves a file or files; the original is deleted once the operation is complete
Top 10 Unix commands 4. rm filename Removes a file, set of files, or folders(s) full of files 5. pwd Displays your present working directory; this is where you currently are in the file system 6. cd directory_name Changes to the specified directory in the filesystem. Without any arguments, it is a shortcut for changing back to your home directory
Top 10 Unix commands 7. man command_name Access built-in documentation for Unix commands 8. less filename Displays a long text file one screen at a time. Pressing the space bar gets the next page. Pressing Q, quits and returns to the command prompt 9. grep pattern filename(s) Searches for a specified pattern across as many files as you desire 10. top Shows the applications and processes that are currently running on your system
Invoking the Python Interpreter From the command line, run : python3 >>> From here you can run python scripts >>> print(3+5) #result is displayed 8
Running Python programs from the command line Run python3 programName.py from the command line python3 myProgram.py