Tuesday, January 11, 2011

Linux: Learn the basics

So, the truth about Linux - I can't tell exactly but the proven fact is Linuxes / Unixes are build for server environments and be the Server rather End client. Servers' need to be very resource efficient and GUIs are never an option when we are critical to our resources.

In short, Linux can be used as Desktop machines but one-way-or-another one needs to use command line to get things done.

While learning to deploy VoIP servers- As I plan on -we must be very friendly with black&white command line screen and learn as we go.

Following are some basic Linux Commands we need every now and then from viewing a directory to creating medium level shell scripts.

Viewing, copying, moving and deleting files


Display the contents of the current directory

ls -a

Display also hidden files and hidden directories

cp srcfilename /path/destfilename

Copy srcfilename into directory /path with name destfilename

cp -r /dir/name /path/dir/name

Copy the entire directory /name into /path/dir/name

rm name

Remove a file or directory called name

rm -r name

Remove an entire directory as well as its included files and subdirectories

mv filename /path/dir_name

Move file:filename into directory:/path/dir_name

mv oldfilename1 newfilename2

Rename oldfilename1 to newfilename2

cat myfile.txt

Display myfile.txt contents to screen

more myfile.txt

Display contents of myfile.txt in pages Press spacebar to view next page

head myfile.txt

Display first 10 lines of myfile.txt

head -15 impfile.file

Display first 15 lines of impfile.file

tail filename

Display last 10 lines of filename

tail -15 filename

Display last 15 lines filename


Display current working directory

cd /path/dir/name

Change directory to /path/dir/name

cd ..

Go directory up one step

mkdir dir_name

Create directory dir_name

rmdir dir_name

Delete directory dir_name

I'll bring you guys with more commands and try not to overload. Meanwhile keep on practicing :)

No comments:

Post a Comment