User Tools

Site Tools


sysadmin:linux:basic_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
sysadmin:linux:basic_commands [2025/12/16 03:04] mlivolsisysadmin: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're doing. Especially useful: the 'idle' part. This allows you to see whether they're actually sitting there typing away at their keyboards right at the  moment.| |w |tells you who's logged in, and what they're doing. Especially useful: the 'idle' part. This allows you to see whether they're actually sitting there typing away at their keyboards right at the  moment.|
 |who |tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.| |who |tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.|
-|finger username | gives you lots of information about that user, e.g. when they last  read their |mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in  a file called .plan.  This information is also displayed by 'finger'|+|finger username | gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in a file called .plan. This information is also displayed by 'finger'|
 |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's logins.| |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's logins.|
  
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't 'die' properly, use the option -9. But attempt without that option first, because it doesn't give the process a chance to finish possibly important business before dying. You may need to kill processes for example if your modem connection was interrupted and you didn't get logged out properly, which sometimes happens.| |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't 'die' properly, use the option -9. But attempt without that option first, because it doesn't give the process a chance to finish possibly important business before dying. You may need to kill processes for example if your modem connection was interrupted and you didn't get logged out properly, which sometimes happens.|
 |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