====== Unix command line cheat sheet ======
<code>
File Commands
ls - directory listing
ls -a - directo... contents of file
head file - output the first 10 lines of file
tail file - output the last 10 lines of file
tail -f file - output the contents of file as it grows, starting with the last 10 lines
sed 's/foo/bar/g' file - replaces all occurrence
====== Lightning fast command line use in Linux ======
You can use keyboard shortcuts and other command line tricks to make entering commands easier and faste... n terminal:
| Ctrl-a | Move to the start of the line. |
| Ctrl-e | Move to the end of the line. |
| Alt-] x | Moves the cursor forward to the next occurre
====== vim show linenumbers ======
Displaying line numbers while editing a file can be handy. This recipe describes how to turn on and off the display of line numbers in vi and vim.
While editing a document... ot inserting text), type the following to turn on line numbers:
:set number
If you tire of the line
ources.list'' and add ''non-free contrib'' to all lines after ''main'', like so:
<code>
...
deb http://m... tice that the '\' is also removed from the second line.
Even more output
If you're after even more outp... t.
Open /etc/default/grub and find the following line:
GRUB_CMDLINE_LINUX=""
Add the verbose option... Open ''/etc/default/grub'' and find the following line:
GRUB_CMDLINE_LINUX=""
Add the elevator optio
====== Word footnotes have undeletable extra lines ======
====== Word Fussnoten haben nicht löschbare l... dit the separator. You'll probably see some blank lines before and/or after the little horizontal separator line itself. Delete those and close and go back to Pri... ph style doesn't include formatting
such as "Keep lines together", which could cause a lot of white spac
text editor with root permissions and look for a line with the following section of text:
relatime,e... en /boot/grub/menu.lst and find the following two lines:
# defoptions quiet splash
#altoptions=(rec... hem append the following at the end of both those lines:
rootflags=data=writeback
then save and exit
====== Search Google.com from the Linux command line ======
You can search Google.com from the Linux command line without using a CLI web browser like lynx or Elin... ips4linux.com/search-googlecom-from-the-linux-command-line/
{{tag>linux}}
~~LINKBACK~~
~~DISCUSSION~~
them, but did you know there's a built-in command-line utility that can do just that? Here's how to do i... le to use the cipher.exe utility from the command line to securely overwrite files—all you need to do is... /securely-overwrite-files-with-a-built+in-command-line-trick?utm_source=feedburner&utm_medium=feed&utm_c
The allow/deny files consist of one user name per line.
==== Commands ====
export EDITOR=vi ;to spec... 5/15 do at 5,20,35,50
''
==== Example ====
A line in crontab file like below removes the tmp files... the following command At the end of the cron job line .
''
>/dev/null 2>&1
''
==== Generate log
tc/logrotate.d/apache2 and make sure it has these lines
create 644 root adm
prerotate
nice ... can edit /etc/apache2/conf.d/awstats and add this line.
RedirectMatch ^/logs /cgi-bin/awstats.pl
Now
Windows box from your Linux machine, the Command-Line Fu web site has you covered with the quick and ea... ssword section, you'll be prompted on the command line for the password—which might be more secure if yo
====== Tasks that are best done on the command line ======
Here are a few tasks that you might want to consider using the command line for.
===== Resizing images =====
Unless you are
script file like so:
sedscript - one command per line
s/#00CC00/#9900CC/g
s/#990099/#000000/g
s/#... amples
Trim whitespace from beginning and end of line
You *might* have to type a tab instead of t here ... hould bookmark
* http://sed.sourceforge.net/sed1line.txt – Eric Pement
* http://www.catonmat.net/blo