Saturday 29 September 2012

Linux Basic Commands

$ -- Normal User Prompt
# -- System Admin Prompt

Commands

$ logname  (or) whoami  --------- To Check Present Working User

$ who ---------------------------- To Know Present Working Users
$ hostname --------To Know HostName(Machine Name) Of A Server
$ ifconfig ---------- To Find an IP 
$ lscpu ------------- To check CPU architecture
$ su [super user name] ---- Switch to Super User
$ clear---------- To Clear Screen
$ exit ------------To exit From user Session
$ man [cmd]----------- Help Facility 
$ date ----------- To Display date 
$ cal [month] [year] ----- To Display Calender
$ pwd ---------- To Know Present Working Directory
$ ls [flags]--------------To Display Directory Content
$ mkdir [dir name]---------- To Create New Directory
$ cd  [dir name] -------------- To Change Directory
$ mv [oldname] [newname) -------- To Rename Directory 
$ rmdir [Directory Name] ---------- To delete directory
$ mv [source path] [target path] ---- To Move directory with sub directories 
$ cp [source path] [target path] ---- To Copy directory with sub directories 
$ cat > [file name] ----------------- To Create  File
$ cp [source file] [target file] ------- To Copy A File
$ mv [Old File] [New File] --------- To Rename A File
$ rm [file name] --------------------- To Remove A File
$ locate [file name] ------------------- To Search A file In Whole File System
$ find [file name] [path] ---------------- To Search A file in Specified Path
$ gzip [file name] ---------------------- To Compress A File
$ gunzip [file name] ------------------- To Uncompressed A File
$ chmod [777] [file name] ------------- To Change File Permissions 
$ chown  [new owner name] [file name] --- To Change Owner
$ chgrp [new group name] [file name] ----- Change Group To A File
$ useradd -u [uid] -g [group name] -d [user home dir] -s [shell]- Creating New User
$ groupadd -g [group id] [group name] ------ To Create New Group
$ userdel [user name] ------ To Delete  User
$ shutdown [time] -------- To Shutdown System At Particular Time
$ shutdown -r now ------------- Shutdown and reboot immediately
$ shutdown -h halt -------------- Shutdown immediately and halt
$ df/df-k/df -g/df -h ---------- To Check Free Disk Space
$ du / du -s [dir name] ------- To Check Used Space 
$ vi [file name] -------------- To Open a File with VI Editor
$ head -n [no of lines] [file name] ---- To Display First N line in A File
$ tail -n [no of line] [file name] --------  To Display Last N lines In A File
  

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Best Regards,
MADHU K
IBM MQ Certified Professional
HYDERABAD
+917893751171/+919964371404
mailme.mq@gmail.com
trainingontech.com
http://www.ibmmqadmin-madhu.blogspot.in