sysadmin:linux:basic_commands
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sysadmin:linux:basic_commands [2025/12/16 03:04] – mlivolsi | sysadmin:linux:basic_commands [2025/12/16 03:09] (current) – mlivolsi | ||
|---|---|---|---|
| Line 32: | Line 32: | ||
| **Finding things** | **Finding things** | ||
| - | |find |find files anywhere on the system. This can be extremely useful if you've forgotten in which directory you put a file, but do remember the name. (ie. find . –name foo.bar –print | + | |find |find files anywhere on the system. This can be extremely useful if you've forgotten in which directory you put a file, but do remember the name. (ie. find . –name foo.bar –print )| |
| |grep string filename(s) | looks for the string in the files. This can be useful a lot of purposes, e.g. finding the right file among many, figuring out which is the right version of something, and even doing serious corpus work. grep comes in several varieties (grep, egrep, and fgrep) and has a lot of very flexible options. Check out the man pages if this sounds good to you.| | |grep string filename(s) | looks for the string in the files. This can be useful a lot of purposes, e.g. finding the right file among many, figuring out which is the right version of something, and even doing serious corpus work. grep comes in several varieties (grep, egrep, and fgrep) and has a lot of very flexible options. Check out the man pages if this sounds good to you.| | ||
| Line 39: | Line 39: | ||
| |w |tells you who's logged in, and what they' | |w |tells you who's logged in, and what they' | ||
| |who |tells you who's logged on, and where they' | |who |tells you who's logged on, and where they' | ||
| - | |finger username | gives you lots of information about that user, e.g. when they last read their |mail and whether they' | + | |finger username | gives you lots of information about that user, e.g. when they last read their mail and whether they' |
| |last -1 username | tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone' | |last -1 username | tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone' | ||
| Line 50: | Line 50: | ||
| |kill PID | kills (ends) the processes with the ID you gave. This works only for your own processes, of course. Get the ID by using ps. If the process doesn' | |kill PID | kills (ends) the processes with the ID you gave. This works only for your own processes, of course. Get the ID by using ps. If the process doesn' | ||
| |du filename | shows the disk usage of the files and directories in filename (without argument the current directory is used). du -s gives only a total.| | |du filename | shows the disk usage of the files and directories in filename (without argument the current directory is used). du -s gives only a total.| | ||
| - | |df –k | Available space on all storage devices | | + | |df –k | Available space on all storage devices | |
| |last yourusername | lists your last logins. Can be a useful memory aid for when you were where, how long you've been working for, and keeping track of your phonebill if you're making a non-local phonecall for dialling in.| | |last yourusername | lists your last logins. Can be a useful memory aid for when you were where, how long you've been working for, and keeping track of your phonebill if you're making a non-local phonecall for dialling in.| | ||
| **Connecting to the outside world ** | **Connecting to the outside world ** | ||
| - | |ssh –l username hostname | also lets you connect to a remote host. Use rlogin whenever possible.| | + | |ssh –l username hostname | also lets you connect to a remote host. Use rlogin whenever possible.| |
| |sftp username@hostname | lets you download files from a remote host. This is a common method for exchanging files. The most important commands within sftp are get for getting files from the remote machine, and put for putting them there | | |sftp username@hostname | lets you download files from a remote host. This is a common method for exchanging files. The most important commands within sftp are get for getting files from the remote machine, and put for putting them there | | ||
| - | + | |lynx | lets you browse the web from an ordinary terminal. (not always available) | | |
| - | |lynx | lets you browse the web from an ordinary terminal. (not always available) | | + | |
| **Miscellaneous tools ** | **Miscellaneous tools ** | ||
| - | |date | shows the current date and time.| | + | |date | shows the current date and time.| |
| |cal | shows a calendar of the current month. Use e.g., 'cal 10 1995' to get that for October 95, or 'cal 1995' to get the whole year.| | |cal | shows a calendar of the current month. Use e.g., 'cal 10 1995' to get that for October 95, or 'cal 1995' to get the whole year.| | ||
| |bc | basic calculator (control-d to quit) | | |bc | basic calculator (control-d to quit) | | ||
sysadmin/linux/basic_commands.txt · Last modified: by mlivolsi
