Category
cmd
-
02.23.10Force fsck at next boot# touch /forcefsck Creating an empty forcefsck file in the root directoy will force fsck to run at the next boot.
-
12.31.09Make LoveIn FreeBSD: $ cd /usr/src $ make love Enjoy the output. Merry Christmas! Source: psybermonkey
-
11.27.09Ignoring an aliasSometimes I want to ignore an alias. That might seem to make no sense because one of the reasons (the reason?) to use an alias (like ls='ls --color') is creating shortcuts. But, in some cases I need to use the real command, with its real output. In my case, it is because I share the same username with other people on some systems (yes, it is pretty awful, but that is another issue). To do this, precede the command with a backslash: '\'. For example: $ \ls Update: As loood has said in the comments, typing the command in quotes has the same ...
-
09.22.09Listing all service status# service --status-all anacron (pid 2435) is running... atd (pid 2405) is running... auditd (pid 1777) is running... Avahi daemon is running cpuspeed is stopped crond (pid 2385) is running... cupsd (pid 2424) is running... dnsmasq is stopped hald (pid 2129) is running... httpd is stopped [...] Runs all init scripts (located in /etc/init.d), in alphabetical order, with the status option. Note: Only in Red Hat and redhat-like distros (Fedora, Mandriva,...).
-
09.03.09Refreshing bash configurationAfter writting some changes in the .bashrc file, you can reload it running this command: $ source ~/.bashrc or the even simpler $ . ~/.bashrc
-
07.13.09OR in grep$ egrep "regexp1|regexp2" file1 file2 Search one or more files (file1 and file2 in our example) for lines that match any of several (two in our case) regular expressions: regexp1 OR regexp2. The '|' stands for the OR.
-
07.10.09Adding password protection on a file with vim$ vim -x filename The -x option uses encryption when writing the file. It will ask for a key: Enter encryption key: ****** Enter same key again: ****** From then on your filename will be encrypted and accessed using the password. The -x option will no longer be necessary when editing the file.
-
05.18.09Vi: emptying a file in one shot:1,$d This vi command blanks out the file being edited. Updated: javisantana suggested another way to emptying a file. Type: ggdG in command mode.
-
05.12.09Quick access to the ASCII tableman ascii Prints octal, hexadecimal and decimal listings of the ASCII character set.
-
04.17.09Showing a computer’s open ports$ netstat -an | grep -i listen Shows the open ports on all the IPs of the computer the command is run on.