List of useful inux command which i came across
1. ctrl + r to know the old commands typed
2. !ca this execute old executed cat command
a. first typed gdb ../test.out
b. !gd to execute above command
3a. to create the new command in the linux using /etc/bashrc file:
example:
-> my new command "lsf" tells the output of the 3 commands:
-> Add this command at the end of the /etc/bashrc file
function lsf
{
ls -ltrh | more
ls | wc
date
}
3b. or another way to create new command:
a. put necessary command in one file.
b. then change its mode and copy into /bin. so you can access from anywhere in the linux prompt
ex:
[root@localhost ~]# cat mycmd
killall -9 telnet
ps -aH
[root@localhost ~]# chmod 777 mycmd
[root@localhost ~]# cp mycmd /bin/
[root@localhost ~]# cd /home/
[root@localhost home]# mycmd
telnet: no process killed
PID TTY TIME CMD
32199 pts/42 00:00:00 vim
1958 pts/40 00:00:00 vim
1971 pts/39 00:00:00 vim
12485 pts/55 00:00:01 vim
12486 pts/55 00:00:00 cscope
4. how to use cscope?
a. #cscope -uR for first time
b. #cscope -d for next time to use exisiting cscope.out file
1. ctrl + r to know the old commands typed
2. !ca this execute old executed cat command
a. first typed gdb ../test.out
b. !gd to execute above command
3a. to create the new command in the linux using /etc/bashrc file:
example:
-> my new command "lsf" tells the output of the 3 commands:
-> Add this command at the end of the /etc/bashrc file
function lsf
{
ls -ltrh | more
ls | wc
date
}
3b. or another way to create new command:
a. put necessary command in one file.
b. then change its mode and copy into /bin. so you can access from anywhere in the linux prompt
ex:
[root@localhost ~]# cat mycmd
killall -9 telnet
ps -aH
[root@localhost ~]# chmod 777 mycmd
[root@localhost ~]# cp mycmd /bin/
[root@localhost ~]# cd /home/
[root@localhost home]# mycmd
telnet: no process killed
PID TTY TIME CMD
32199 pts/42 00:00:00 vim
1958 pts/40 00:00:00 vim
1971 pts/39 00:00:00 vim
12485 pts/55 00:00:01 vim
12486 pts/55 00:00:00 cscope
4. how to use cscope?
a. #cscope -uR for first time
b. #cscope -d for next time to use exisiting cscope.out file
No comments:
Post a Comment