Perl cheatsheet
If you are looking for my Perl cheatsheet, it's over here. Lots of interesting stuff in that repo.
If you are looking for my Perl cheatsheet, it's over here. Lots of interesting stuff in that repo.
Although similar to Perl, PCRE has some syntax that can be difficult to remember. When I'm working with CFEngine I often have to look it up. Here is a cheat-sheet to save time.
0 | Go into boot prompt (OK). |
1 | Put the system in system administrator mode. All file systems are mounted. Only a small set of essential kernel processes are left running. This mode is for administrative tasks such as installing optional utility packages. All files are accessible and no users are logged in on the system. |
2 | Put the system in multi-user mode. All multi-user environment terminal processes and daemons are spawned. This state is commonly referred to as the multi-user state. |
3 | Start the remote file sharing processes and dae mons. Mount and advertise remote resources. Run level 3 extends multi-user mode and is known as the remote-file-sharing state. |
4 | Is available to be defined as an alternative multi-user environment configuration. It is not necessary for system operation and is usually not used. |
5 | Shut the machine down so that it is safe to remove the power. Have the machine remove power, if possible. |
6 | Stop the operating system and reboot to the state defined by the initdefault entry in /etc/inittab. |
|
Reboot and issue boot -x (boot to non-cluster mode) at boot prompt. |
|
Reboot and issue `boot -xs` (single user, non-cluster mode) at boot prompt. |
|
Reboot and issue boot -r (reconfigure) at boot prompt. |
Download and build source package | apt-get -b source |
Download and install dependencies for source package | apt-get build-dep |
Download source package | apt-get source |
Install package "on demand" | auto-apt run |
List contents of a package | apt-file list |
List installed packages | dpkg -l |
Remove package and configuration files | apt-get --purge remove |
Search for Debian Packages | http://www.debian.org/distrib/packages |
Search for packages | apt-cache search |
Show package dependencies | apt-cache depends |
Show package information | apt-cache show |
Show package that supplies a given file | apt-file search |
Show package that supplies a given file | COLUMNS=132 dpkg -S |
Show source package information | apt-cache showsrc |
Update `apt-file and auto-apt database | apt-file update |
The following may not apply to all shells.
ctrl-q
bg <job number>
fg <job number>
ctrl-y
ctrl-z
!66
!!
!$
!*
history -c
history -d <number>
find -type f -name "*.rpmnew" | sed 's/\(^.*\)\(\.rpmnew\)$/mv -f \1\2 \1/' |sh
find /path -name "*.*" -exec | perl -pi -e 's///g' {} \;
set -o vi
Now esc to enter command mode where vi keys
work. Pressing enter returns to normal mode.