Pick a Free OS

Linux Basics : First Steps Into Linux

the directory in which you presently are. It is used without flags

simply as \'pwd\'

The su command

Many a times you might have logged in as a normal used and might need

to be root to install a software or for some other small task. You

could logout then login as root complete the work logout and login

back as a normal user. Instead, you can just use the su command. The format

is :



eg : su root

when you \'su\' to become root from a normal user, you are asked for the

root password. But if you are root, you can use \'su\' to become any

user without using a password. Once your work is finished, use \'exit\'

to become yourself.

The whoami command

Sorry folks! This command won\'t solve your teenage identity crisis but

it will tell you which user you are logged in as. Useful when you

have used \'su\' many times and now don\'t know who you are.

The cp command

This one copies files / directories from one place to another it\'s syntax



source_file_with_path destination_path

eg : cp /home/aarjav/secret.txt /ftp/pub

This would make all my secrets public :). But my secrets wouldn\'t fit

on my 8.4 Gb hard-disk ;) The cp command can be used with some useful flags

also :



Interactive copying, prompts before overwriting files or directories


-l source_file_with_path destination_path

Makes a link (shortcut) to the source_file at the destination

path instead of actually copying it there.

cp -p

Preserve file attributes while copying if possible

cp -R

Copy Recursively . Used when copying directories.

This command also copies the contents of the subdirectories.




i.e. Copy only if the source file is newer than the destination file

or the destination file does not exist.


rm command

The rm command is used to remove or delete files or directories. Its general

format is:


-flag file_or_directory_with_path

eg : rm /home/aarjav/waste.txt

Some flags which can be used with the rm command are

rm -v file.txt


verbosely, explain what is being done.

rm -r my_directory


the directory and its contents recursively.