Ubuntu Kung Fu

Ubuntu kung fu tips site
Ubuntu psychocats tips site

text editor features


log file descriptions

/proc - filesystem window into hardware

Setting environment variables, see forum
~/.profile - per-user environment, source reloads in current terminal

/etc/environment - simple key=values, no expansion, system wide environment loaded at boot, source reloads in current terminal shell

A single dot followed by a file is the same as 'source file' which runs in the same shell not a new shell, i.e., '. .bashrc'

sudo gedit /etc/profile - system wide bourn shell environment, only gets read by login shells. For graphical logins you don't get a login shell so it's up to the X session configuration to read /etc/profile. It seems that gdm and kdm are doing this with most Linux distributions, but others may not.

gedit ~/.bashrc to edit local environment

/etc/bash.bashrc

group management

List all groups a user belongs to: groups


linux cheat-sheet



To get list of UUIDs: ls /dev/disk/by-uuid -alh
sudo gedit /etc/fstab
mkdir /media/
reload /etc/fstab with mount -a

To check kernel messages:
dmesg | tail

Restart window manager (logs out and back in)
Ctrl+Alt+Backspace or
compiz --replace

'sudo -l' lists all the commands that are accessible to you

Drop to shell
If you press "ctrl-alt-F1" from X11, you will switch to the first virtual console (F2 will get you to the second, et cetera). From there, you can switch virtual consoles with alt-f2, alt-f3, alt-f4 and so on.

On Ubuntu, X11 will run on console #7, so alt-f7 will take you back to X11. BUT, if you use ctrl-alt-backspace from X11, it will EXIT and throw you back to the console it was started from (most likely #1). alt-f7 will not bring you back to X11, because it's not running anymore.

root access temporarily so you don't have to sudo on each command
'sudo su -'

scp SourceFile user@host:directory/TargetFile
scp user@host:directory/SourceFile TargetFile

To see what process is holding a given port open:
lsof –i4:

lsof lists open files
top
vmstat

startup / shutdown scripts

script example

adding/removing scripts

Commands that work on gzipped files:
zgrep, zdiff, zmore, zcmp, zmore

Start/starting and killing gnome gdm x11

Change password:

Somewhere between Ubuntu 8.04 and 9.10 the password complexity was changed.
To reduce the password complexity edit /etc/pam.d/common-password
Remove obscure from the line that reads:
password [success=1 default=ignore] pam_unix.so obscure sha512

passwd [account name]
old password
new password
new password

Comments

Popular posts from this blog

Oracle JDBC ReadTimeout QueryTimeout

Locks held on Oracle for hours after sessions abnormally terminated by node failure

Sites, Newsletters, and Blogs