4

Click here to load reader

Basic Linux Commands by T@R@24

Embed Size (px)

Citation preview

Page 1: Basic Linux Commands by T@R@24

Basic linux commandsCommand Syntax Usage

cd cd Change to home directory

cd   <path_to_directory> Change to specificed directory

cp cp [OPTION]... SOURCE DEST Copy files and directories

cp   -R   <source_dir>   <destination_dir>

Copy directories recursively

chmod chmod [OPTION]... MODE[,MODE]... FILE...

Change read/write/execute permissions of files and directories

chmod  -R  MODE  DIRECTORY Change permissions of files and directories recursively

chmod  750  FILE Owner can read/write/executeGroup can read/executeOther can not do anything

chmod  755  FILE Owner can read/write/executeGroup can read/executeOther can read/execute

chmod  775  FILE Owner can read/write/executeGroup can read/write/executeOther can read/execute

chmod  777  FILE Owner can read/write/executeGroup can read/write/executeOther can read/write/execute

chown chown [OPTION]... OWNER[:[GROUP]] FILE...

Change file owner and group

chown [OPTION]... :GROUP FILE...

Change file group

chown  -R  OWNER[:[GROUP]] DIRECTORY

Change owner and group of files and directories recursively

find find [path...] [expression] Search for files in a directory hierarchy

find / -name *.pl Search for files with extension ".pl" from root directory

groups groups Print the groups a user belongs to

ipaddr ipaddr Display IP address of computer

jobs jobs Show jobs of a user

kill kill [pid | job] Terminate process or job

Page 2: Basic Linux Commands by T@R@24

lp lp  -d  <printer_name> Send requests to LPR print service

ls ls [OPTION]... [FILE]... List directory contents

ls -a Display hidden files and directories in listing

ls -l Display in long list format

ls -la Display hidden files and directories in long list format

lpq lpq Spool queue examination program for default printer

lpq  -P  <printer_name> Spool queue for specificed printer

lpr lpr  -P   <printer_name> Off-line print

locate locate  NAME Locate a command or a file or a directory

mv mv  SOURCE   DEST Move file or directory

mv   OLD_FILE_NAME   NEW_FILE_NAME

Rename file or directory

more more  FILE File perusal filter for crt viewing

mkdir mkdir   <directory_name> Make directories

ps ps  [options] Report process status

ps  -ef Report all processes with full listing

pwd pwd Print name of current/working directory

passwd passwd Change your password

rm rm [OPTION]... FILE... Remove files or directories

rm -fr  <directory_name> Remove the contents of directories recursively and ignore nonexistent files, never prompt

rpm rpm -qa | more Gradually display rpm packages installed in workstation.

rmdir rmdir [OPTION]... DIRECTORY...

Remove empty directories

w w  -  [husfV]  [user] Show who is logged in and what they are doing