-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.sh
44 lines (31 loc) · 856 Bytes
/
notes.sh
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
# 1. Command for date:
(date +%F)
# 2. contians retur code for previously code
echo "$?"
# 3. Reading man page
/search_term
n -> next serarch
shift+n previous
\q quitw
# 4. Makedir create parents
mkdir -p some_dir_path
# 5. Semicolor will alow next command to run even after failure
# 6. Current PID of shell
ps -p $$
#7. TRap command can be used to run command after exit of file
trap "rm $PID_FILE; exit" SIGHUP SIGINT SIGTERM
#8. Logger
logger "Message"
logger -p local0.info "Message"
logger -t myscript -p local0.info "Message"
logger -i -t myscript "Message"
#9. Set command, less is pager
help set | less
#10. (CLRF)To view carrige retunrn of windows text file
cat -v
file #this will alert for th file for carrige return
dos2unix # this will convert dos file to unix
#11. Finding program executable
type -a
example:
type - a sed