Friday, 14 September 2012
How To Find The Location Of Command In Linux
Sometimes you need to find the pathnames or locations of commands you use frequently. In this post, I am going to discuss two useful commands that are useful for locating Linux commands.
The first command to locate the Linux commands is which. This command returns the pathnames of the files or links. However, it does not follow the symbolic links.
You can also find the pathnames of multiple commands at once using which command.
The other command is type command which is useful to determine if a command is an alias, a built-in command or an independent command.
You can play more with the type command. I hope this helps :)
The first command to locate the Linux commands is which. This command returns the pathnames of the files or links. However, it does not follow the symbolic links.
samar@Techgaun:~$ which bash
/bin/bash
/bin/bash
You can also find the pathnames of multiple commands at once using which command.
samar@Techgaun:~$ which -a bash cat ls iftop
/bin/bash
/bin/cat
/bin/ls
/usr/sbin/iftop
/bin/bash
/bin/cat
/bin/ls
/usr/sbin/iftop
The other command is type command which is useful to determine if a command is an alias, a built-in command or an independent command.
samar@Techgaun:~$ type gedit
gedit is /usr/bin/gedit
samar@Techgaun:~$ type grep
grep is aliased to `grep --color=auto'
samar@Techgaun:~$ type -t iftop
file
gedit is /usr/bin/gedit
samar@Techgaun:~$ type grep
grep is aliased to `grep --color=auto'
samar@Techgaun:~$ type -t iftop
file
You can play more with the type command. I hope this helps :)
Labels:
command line,
linux,
ubuntu
Bookmark this post:blogger tutorials
Social Bookmarking Blogger Widget |
How To Find The Location Of Command In Linux
2012-09-14T01:05:00+05:45
Cool Samar
command line|linux|ubuntu|
Subscribe to:
Post Comments (Atom)