< Browse > Home / Linux / Blog article: Basic Linux Terminal Commands

Basic Linux Terminal Commands

June 5th, 2008 | No Comments | Posted in Linux by Diego

If you are new to Linux and it’s terminal, you might be wondering how to move around? I’ll show you how with some basic terminal commands.



Below I’ll list a few examples with comments denoted by //

//Displays contents in folder
ls

//Changes Directory
cd FOLDERNAME

//Go up one directory
cd ..

//Go to your home
cd

//Make directory
mkdir FOLDERNAME

//Remove a file
rm — FILENAME

//Copy a file
cp ORIGINALFILE NEWFILE

//Move a file
mv SOURCE DESTINATION

//Install Program
sudo apt-get install PROGRAMNAME

//To run a program you usually specify the name, if text editor, its usually name of program and text file to create, if no file is specified, the text editor still opens.
firefox
emacs hello_world.cpp

//Compile a program using g++
g++ hello_world.cpp

//Execute program
./PROGRAMNAME
./a.out  
 


An example of finding help for a certain command is the following:

rm –help


By asking for help, you’ll receive the type of arguments this command accepts, and how to use it.

Example using the terminal

Let’s say we want to view the contents of a folder, create a folder called Example, create a text file using emacs, compile it, run it, and go back to our home directory. To do this, we would simply do the following.

ls
mkdir C++
cd C++
emacs hello_world.cpp
g++ hello_world.cpp
./a.out
cd
 


Yes there are numerous ways to achieve this, its just a matter of how you want to navigate the terminal.

What now?


If you feel another basic command needs to be here or need more help, simply drop in a line in the comments box! I’ll be sure to put it down.

Expect advanced terminal commands in the near future.



Leave a Reply |

Related Posts to Basic Linux Terminal Commands

Leave a Reply