First commands for the Linux Terminal
Published on March 08, 2020
In this post I will write the main commands of the linux terminal for you to learn in a simple way.
The main objective here is to enable you to take the first steps in the Unix environment, ok?
Let's Go !
Getting started
To start we'll open the terminal. You have two ways to do this :
- Search for Terminal
- Press CTRL + ALT + T
That done, let's go to the main commands used for navigation in the terminal!
Commands
- ls (lists the contents of the current directory)
$ ls
- ls -a (lists all content, including hidden files and executable files)
$ ls -a
- ls -l (lists all detailed content)
$ ls -l
- pwd (informs the current directory)
$ pwd
- cd (change to directory)
$ cd Downloads
- cd - (go back to the previous directory)
$ cd -
- cd .. (go back to the directory above)
$ cd ..
- mkdir [name to new folder] (create a folder)
$ mkdir my_new_folder
- mkdir [name to folder 1] [name to folder 2] (creates two folders at the same time)
$ mkdir folder1 folder2
- mkdir -p [name to folder]/[name to sub-folder] (create a directory and sub-directory)
$ mkdir -p Photos/Sweet_pictures
Extra commands
- mv [old_name] [new_name] (rename a directory or file)
$ mv Photos_folder Pictures
$ mv code_01.txt code.c
- mv [old_directory] [new_directory] (change a folder/file directory)
$ mv main.c codes/main.c
$ mv Downloads/Vacation_Photos Images/Vacation_Photos
- cp [file/folder] [new_directory] (copy a folder/file to other directory)
$ cp main.c Codes/
- clear or CTRL + C (clear the window)
$ clear
- cat > [file_name] (create and write in new file)
$ cat > test.txt
- touch [file_name] (create a file)
$ touch test
- locate [file_name] (locate a file)
$ locate image.jpg
Some shortcuts in the terminal
- CTRL C (ENDS a command/process)
- CTRL Z (STOPS a command/process)
- CTRL A (back to beginning of the command line)
- CTRL U (erase the typed line)
From these tips you are ready to start your Linux journey!
Don't give up and continue!
Until nex time, bye !
If you like it, share it!