Thursday, August 20, 2009

Basic Linux

1. We can login in Linux through GUI or virtual console. We can switch to different virtual consoles by pressing Ctrl+Alt+F[1-7] keys together. We can move into any virtual consoles. (Try in Red Hat)

2. When Linux is installed the default user created is root.

3. Some basic Linux commands are:-

(a.) pwd (Present Working Directory)
for root user it will show /root
for other user it will show /home/sam (e.g. sam is user)

(b.) clear (To clear screen) or Ctrl+l

(c.) ls (Shows list of files and directories)

(d.) ls -l or ll ( Long listing of files and directories)

(e.) ls -lh ( -h is for human readable i.e. size for files or directories. )

(f.) ls -la (-a for all. lists all files and directories including hidden files)

(g.) man e.g. man ls (Manual for command along with options. Helps to get more options for command)

(h.) info e.g. info ls (Detailed information about command)
Note:- Ctr+c or Q to exit from manual page.

(i.) useradd e.g. useradd sam (Creates new user)

(j.) passwd e.g. passwd sam (Assigns password to user)

(k.) id (Print identity for the user)

(l.) who (Lists users currently logged in)

(m.) whoami (List currently logged in user)

(n.) who am i (Shows the virtual console of the current logged in user. e.g. pts pseudo terminal)

(o.) tty (Lists the terminal type)

(p.) mkdir (Creates a new directory)

(q.) rmdir (Remove directory if directory is empty)

(r.) cd .. (Takes you to previous directory)

(s.) cd . (Current directory)

(t.) rm -rf (Removes directory, files and sub directory into it. -r for recursively and f for forcefully)

(u.) userdel -r (Removes user)

2 comments:

  1. thanks for delivering a simple tutorial for linux....also this is for information that if you press the first few letters of command and press tab,it displays all the possible commands :) .. i wish something same is there for the options too :(

    -- subhajit

    ReplyDelete