Friday 2 August 2019

Linux Commands


Device Management
Ctrl + shift + “+”
Zoom IN
Ctrl + “-”
Zoom out
sudo su
super user do, can loggin as root user
who
User logged in
whoami
Current user logged in
man
Manual pages info
who -b
last system boot time and date
cal, cal -1, cal -3
calendar
clear
clears the screen
File System Management
pwd
Present working directory
cd bin
Change directory
cd ..
go to previous directory
cd ../..
go back to 2nd previous directory
cd ~
shows default location, ~ tilt
cd -
shows current location
ls
List file and directory available at current location
ls -F
list symbolic files and directories
ls -l
list file info in long listing format, display will be following
total 5 – total 5 bock assigned
-   >file type (normal file)
rw-rw-r--    >file permission
1   >number of linked files
rahul    >file owner
rahul    >file group
21     >file bytes size
Aug    >month of file creation
30     >date
12:09    >time
rahul   >file name
ls –t
display time based assigning order files, latest file first display
ls -1
every line 1 and 1 file will be displayed
ls -s
size of block per file
ls -S
big size file will be displayed first, descending order
ls -i
display files with inode number, file index number at location
ls R*
list file name beginning with letter R
ls -a
show hidden file/directory as well, “.” Will show system defined/related hidden CURRENT directories information,
 “. .” parent directory
ls ?
display only single character file
ls ??
two character file
ls [abcd]*
display any/all file names starting with either a,b,c or d
ls [a-d]*
list files names starting with either a,b,c or d
cat > .rahul
“.” Means create user defined hidden file
cat .rahul
open hidden file name rahul
cat > rahul
create rahul file with ASCII text input, ctrl + d to save and exit
cat < Rahul
display file Rahul, input redirectional operator
cat >>
append lines to a file, append redirectional operator
cat ?
display content of single character file
touch file1 file2
multiple empty files creation
touch –a file1
change only the access time
touch –d ‘ date month year time’ file1
change last modification time
stat file1
status of file ,access, modify , change details of file1
touch –m file1
change only the modification time
file *
shows file details, empty files
mkdir .dir3
create hidden directory name dir3
mkdir dir1 dir2
empty directories create
rm dir1 dir2 or rmdir dir1
remove only empty directories/files
rm –v file1
will give file removed message, -v verbose “explain ” what is being done by the command
rm –R dir1
can remove non empty directories and file structures
rm ??
files with two character names will be removed
rm [abcd]*
remove files any/all file names starting with either a,b,c or d
rmdir ?
single character named directories will be removed
rmdir *
remove all empty directory from current directory
cp and mv
cp means copy paste and mv means cut paste
mv Linux Unix
rename source file Linux with name Unix
mv .shell shell
hidden file .shell is converted to read file name shell
mv rahul1 rahul2 RAHULKAUL /RAHUL/
cut paste files rahul1,rahul2 and RAHULKAUL from present directory to /RAHUL/ directory
cp shell pearl
copy shell file content to same location with file name as pearl
cp –R
used for coping directories


?
Meta-characters >> special characters perform certain operations in simple way >> wildcard
matches single character at a time
*
asteric > matches single or more character at a time
[ ]
matches any character in list
-
range, from to to












File Permissions
ls -l
-rw-rw-r--

-     Type of the file
rw-  owner/user
rw-  group
r--    others

r-  read
w- write
-   no permission
x-  execute

user+group+others=all   >a
$ chmod
change mode




No comments:

Post a Comment

iRule

  iRule: -- o iRule is a powerful and flexible feature within the BIG-IP local traffic management (LTM). o IRule is a powerful & flexibl...