-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBash Notes.bat
63 lines (56 loc) · 1.67 KB
/
Bash Notes.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@use formatting 'SHELL'
@Theme Bespin
+++ Relative path 'home/Nipuna'
+++ Absolute path '/home/Nipuna'
ls
------------show the content of the curren directory
-a
also list the files and directories starting with a dot (.)
-l
returns the longer version
-alt
pwd
------------currrent absolute path (print working directory)
cd
------------change directory
cd .. (cd<space>..)
------------go one step back
cd ../../action
go back two times and then go into action folder.
touch mytextfile.txt
------------make a text file
cp a.txt b.txt
------------copy content from a to b.
cp a.txt b.txt mydir1
cp a.txt mydir2
cp * ../mynewdir/
cp m*.txt scifi/
_________________________________
mv a.txt b.txt
mv a.txt b.txt mydir1
mv a.txt mydir2
mv * ../mynewdir/
mv m*.txt scifi/
_________________________________
rm a.txt
rm -r comedy #here -r is for recursive.
echo "Hello!"
------------prints it on display.
echo "Nipuna" > mytext.txt
------------prints into the text file
cat mytext.txt
------------reads and prints data from file.
rmdir myfolder
-----------------remove folder
rm -rf myfolder
-f = to ignore non-existent files, never prompt
-r = to remove directories and their contents recursively
----------------------- CHMOD ------------------------------
chmod has permission arguments that are made up of 3 components
1)Who are we changing the permission for? [ugoa] - user (or owner), group, others, all
2)Are we granting or revoking the permission - indicated with either a plus ( + ) or minus ( - )
3)Which permission are we setting? - read ( r ), write ( w ) or execute ( x )
chmod u+rwx myfile.txt
or
chmod u +r +w +x myfile.txt
-------------------------------------------------------------