Terminal

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Terminal

prompt: “prompts” to action, ends with with a dollar sign or percent sign

whoami returns name

lsfiles and folders in current directory

cd

touch create a file in the working directory

for example: touch lily.txt —>ls —> touch.lily will show in the directory

pwd to get the path of your current directory

ls -a see both visible and invisible file in the working directory

cp copies files or directories

cd . . move up one directory

mkdir takes in a directory name as an argument, and then creates a new directory in the current
working directory.

mv move file into a directory with the source file as the first argument and the destination
directory as the second argument

cat  allows us to create single or multiple files, view contain of file, concatenate files and
redirect output in terminal or files

grep  stands for “global regular expression print”. It searches files for lines that match a pattern
and returns the results. It is case sensitive.

rm deletes files

rm -r removes a directory recursively (with files)

rmdir deletes directory

man commandshows the manual for the specified command


chmod ugo filechanges permissions of file to ugo - u is the user's permissions, g is the group's
permissions, and o is everyone else's permissions. The values of u, g, and o can be any number
between 0 and 7

>> takes the standard output of the command on the left and appends (adds) it to the file on the
right. Example: cat glaciers.txt >> rivers.txt

<takes the standard input from the file on the right and inputs it into the program on the left.
Example: cat < lakes.txt

|isa “pipe”. The | takes the standard output of the command on the left, and pipes it as standard
input to the command on the right. You can think of this as “command to command” redirection.
Example: cat volcanoes.txt | wc

echo prints out the next word

CTRL+ L clears the command line

CTRL+ C cancels

You might also like