-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlinux-commands.txt
More file actions
129 lines (75 loc) · 2.15 KB
/
Copy pathlinux-commands.txt
File metadata and controls
129 lines (75 loc) · 2.15 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#- date
#- cal
a- cal 2018
b- cal 12 2018
#- clear
clears screen.
#- ls - list directory contents
a) ls -l or ll
To list files in the current directory with detailed
info.
b) ls -lt
To list files in the current directory with detailed info sorted by
date and time with the newest file first.
c) ls -lh
To list files in the current directory with their
size in human readable format.
d) ls -la
To list all files including the hidden files with
detailed info.
e) ls -ltr
To list files in the current directory with detailed info sorted by
date and time with the newest file first.
#- PWD
Print working directory or your current location.
#- CD
Change directory.
a- cd /usr/bin
b- cd ~ or cd takes your user's home directory
c- cd ~user (another users's home directory)
d- cd /
e- cd - (takes you to the previous directory)
f- cd .. (go up one level)
Compression Tools:
- Compression tools are used to compress one or
more files or an archive to save space.
#- gzip
This command creates a compressed file of each of the
files specified and adds .gz extension to the files.
#- gzip filename
#- ls or ll (check files after compression)
- To uncompress use:
#- gunzip filename
or
#- gzip -d filename
# ls or ll (check files after decompression)
You can also use bzip2 and bunzip2
#- bzip2 filename
#- bunzip2 filename or bzip2 -d filename
cat /etc/profile
Displays the contents of the file profile.
- Using more and less command:
Examples:
#- more /etc/profile
Displays long text files one page at a time, starting
at the beginning.
- Use spacebar to scroll forward one screen at a time.
- Use Enter to scroll one line at a time.
#- less /etc/profile
Similar to more command but offers some extended
capabilities, it is also faster than more as it does
not need to read the entire file before it starts to
show.
#- rm file1
Remove file.
#- rm -i file2
To remove file with confirmation.
#- rm -f file
To remove file forcefully (no confirmation).
- Removing directories:
#- rmdir dir1
To delete an empty directory.
#- rm -r dir1
To delete a non empty directory recursively.
$- rm -rf dir1
To remove a directory recursively and forcefully.