Terminal is a shell which receive/send input and output for command-line program.
Following are some commands you can input in terminal.
Please type often pwd
and ls
to make sure where you are.
ls
means listing, showing the files in current folder.
cd
means change directory, or change to a folder.
eg:
cd desktop
to go to "desktop".
cd ~
or cd
to return to home.
cd desktop/17444519
cd .
to go to current diretory.
cd ..
to return back to the upper directory.
pwd
means print what directory, or show where you are.
Space separates the arguments and commands. So be careful.You can ls
to check the new file or folder.
(Make sure it exists.)
touch
means creat a filerm
means delete a file
eg:
At first, ls
to see files in current folder.
touch ex1.py
to creat a file called "ex1.py",then ls
.
rm ex1.py
to remove a file called "ex1.py".
mkdir
means creat a folderrmdir
means delete a folder
eg:
ls
to see files in current folder.
mkdir Big_data
to creat a new directory, or a folder.
rmdir Big_data
to remove the directory.
mv
means rename
eg:
mv ex1.py exercise.py
to rename "ex1.py" as "exercise.py".
mv 123 456
to rename "123" as "456".
python exercise.py
to execute python scripts.You can open .py by double clicking the file. (If it doesn't work, you can download some third party editors,such as sublime, visual studio code. You can edit .py file by these editors.)
print
is a python language, which means print, or show, in the terminal.
eg:
print "hello"
on sublime to print the string hello.
command+S to save the file as "ex1.py" on desktop.
python ex1.py
on terminal to execute the file.