Basic Linux
Commands
mkdir
- make directories
Ex:
mkdir
folder1
cd
- change directories
mv-
change the name of a directory
Ex:
mv
oldfolder newfolderr
pwd
- print working directory
will show you
the full path to the directory you are currently in.
rmdir
-Remove an existing directory
Ex:
rm
-rf folder1
Force to
remove directories and files within the directories recursively.
chown
- change file owner and group
Ex:
chown
owner:group file
chown -R
owner :group folder
R -recursive
operate on files and directories recursively
chmod
- change file access permissions
Usage
chmod 644
filenames
chmod -R 755
folder
R -recursive
operate on files and directories recursively
4
= r (Read)
2 = w
(Write)
1 = x
(Execute)
CHMOD can
also to attributed by using Numeric Permissions:
400 read by
owner
040 read by
group
004 read by
anybody (other)
200 write by
owner
020 write by
group
002 write by
anybody
100 execute
by owner
010 execute
by group
001 execute
by anybody
ls
- Short listing of directory contents
-a list
hidden files
-dlist the
name of the current directory
-F show
directories with a trailing '/'
-R
list all subdirectories encountered
-t sort by
time modified instead of name
cp
- Copy files and folders
Ex:
cp
exsistingfile newfile
Copy the
files "exsistingfile" to the file "newfile" in
the current working directory.
cp -i
exsistingfile newfile
With the "-i"
option, if the file "newfile" exists, you will be prompted
before it is overwritten.
cp
-avf onefolder anotherfolder
Options
a-All
v-Verbose
f-Force
find
– find files and folders
Ex:
$ find .
-name diag
./Downloads/diag
chmod - change file access permissions
No comments:
Post a Comment