
Terminal - All commands - 10,564 results
for vm in $(vmware-cmd -l);do echo -n "${vm} ";vmware-cmd ${vm} getstate|awk '{print $2 " " $3}';done
This is sample output - yours may be different.
/opt/vmware/vm1/vm1.vmx = on
/opt/vmware/vm2/vm2.vmx = on
/opt/vmware/vm3/vm3.vmx = off
/opt/vmware/vm4/vm4.vmx = on
I use this command on my machines running VMware Server to print out the state of all registered Virtual machines.
rpm -qa | grep PACKAGENAME | xargs rpm -q --filesbypkg
This is sample output - yours may be different.
bash /bin/bash
bash /bin/sh
bash /etc/skel/.bash_logout
bash /etc/skel/.bash_profile
bash /etc/skel/.bashrc
bash /usr/bin/bashbug-32
bash /usr/share/doc/bash-3.1
bash /usr/share/doc/bash-3.1/CHANGES
bash /usr/share/doc/bash-3.1/COMPAT
bash /usr/share/doc/bash-3.1/FAQ
bash /usr/share/doc/bash-3.1/INTRO
bash /usr/share/doc/bash-3.1/NEWS
..
rpm, sometimes, is not wildcard friendly. To search files installed from package this could be useful.
change PACKAGENAME to any package do you want to search
This is sample output - yours may be different.
Create a persistent SSH connection to the host in the background. Combine this with settings in your ~/.ssh/config:
Host host
ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster no
All the SSH connections to the machine will then go through the persisten SSH socket. This is very useful if you are using SSH to synchronize files (using rsync/sftp/cvs/svn) on a regular basis because it won't create a new socket each time to open an ssh connection.
This is sample output - yours may be different.
Run this in / in a chroot to get your own proc there.
This is sample output - yours may be different.
Might match "ping 192.168.0.1" and then run it.
sudo ufw allow proto tcp from 1.2.3.4 to any port 80
This is sample output - yours may be different.
This is sample output - yours may be different.
This is sample output - yours may be different.
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"
[OR]
CentOS release 5.2 (Final)
Works for most distributions, tested on Ubuntu, Fedora, CentOS, Gentoo, SUSE, RedHat.
Debian and Slackware:
cat /etc/*version
This is sample output - yours may be different.
fold wraps text at 80 characters wide, and with the -s flag, only causes wrapping to occur between words rather than through them.
This is sample output - yours may be different.
Creates a full snapshot of your current vim session, including tabs, open buffers, cursor positions, everything. Can be resumed with vim -S . Useful for those times when you HAVE to close vim, but you don't want to lose all your hard-opened buffers and windows. The ! will cause vim to overwrite the file if it already exists. It is not necessary, but useful if you frequently save to the same file (like session.vim or something).
for f in $(ls -d /base/*); do ln -s $f /target; done && ls -al /target
This is sample output - yours may be different.
Symlinks all files in the base directory to the target directory then lists all of the created symlinks.
alias wordpress='mkdir wordpress && cd wordpress && wget http://wordpress.org/latest.tar.gz && tar -xvzf latest.tar.gz && mv wordpress/* . && rm -rf latest.tar.gz wordpress && cp wp-config-sample.php wp-config.php'
This is sample output - yours may be different.
tar cpfP - $(find <somedir> -type f -name *.png) | ssh user@host | tar xpfP -
This is sample output - yours may be different.
Notes:
* Adjust the find command to your own filters.
* The -P flag forces to keep absolute paths in the tarball, so that you can be sure that the exact same file hierarchy will be created on the second machine.
This is sample output - yours may be different.
This is sample output - yours may be different.
Opens or closes the cdrom device.
This is sample output - yours may be different.
Useful to archive files once a day:
cp file file.$(date --iso)
This is sample output - yours may be different.
This is sample output - yours may be different.
Screen key bindings, page 1 of 1.
Command key: ^A Literal ^A: a
break ^B b flow ^F f lockscreen ^X x pow_break B screen ^C c width W
clear C focus ^I log H pow_detach D select ' windows ^W w
colon : hardcopy h login L prev ^H ^P p ^? silence _ wrap ^R r
copy ^[ [ help ? meta a quit \ split S writebuf >
detach ^D d history { } monitor M readbuf < suspend ^Z z xoff ^S s
digraph ^V info i next ^@ ^N sp n redisplay ^L l time ^T t xon ^Q q
displays * kill K k number N remove X title A
dumptermcap . lastmsg ^M m only Q removebuf = vbell ^G
fit F license , other ^A reset Z version v
Displays a list of all the basic keyboard shortcuts in screen.
This is sample output - yours may be different.
You can then switch from a file to another with ^W^W
This is sample output - yours may be different.
dmidecode | grep -i prod
Product Name: HP dx2480 MT(FX800PA)
Product Name: 0B08h
This command gives a model information of a computer. Also useful in determining the host is a VM machine or actual physical machine.
IPADDR=`ifconfig eth0 | grep -i inet | awk -F: '{print $2}'| awk '{print $1}'`
This is sample output - yours may be different.
IPADDR=`ifconfig | grep -i inet | awk -F: '{print $2}'| awk '{print $1}'`
echo $IPADDR
193.122.18.101
Useful in scripts while you just need an IP address in a variable.
This is sample output - yours may be different.
Deletes thousands of files at one go, I'm not able to recall the exact # of files that rm can delete at one go(apprx. around 7000.)
blockdev --rereadpt /dev/sda
This is sample output - yours may be different.
count=`wc -l file | cut -d ' ' -f1`
This is sample output - yours may be different.
bash -x ./post_to_commandlinefu.sh
This is sample output - yours may be different.
bash -x ./post_to_commandlinefu.sh bash -x ./post_to_commandlinefu.sh
+ COMMAND='bash -x ./post_to_commandlinefu.sh'
+ echo 'command is bash -x ./post_to_commandlinefu.sh'
command is bash -x ./post_to_commandlinefu.sh
+ '[' 'bash -x ./post_to_commandlinefu.sh' = '' ']'
+ SESSIONFILE=./.c
+ LOGINURL=http://www.commandlinefu.com/users/signin
+ EDITURL=http://www.commandlinefu.com/commands/edit
++ dirname ./.c
++ basename ./.c
+ find . -name .c -mtime +1 -exec rm '{}' ';'
+ '[' '!' -f ./.c ']'
+ echo -n 'Enter commandlinefu username: '
Enter commandlinefu username: + read USERNAME
+ echo -n 'Enter commandlinefu password: '
Enter commandlinefu password: + read -s PASSWORD
+ echo
+ wget -O - --save-cookies ./.c --keep-session-cookies --post-data 'username=&password=&remember=on&submit=Let me in!' http://www.commandlinefu.com/users/signin
+ echo -n 'Enter summary (required): '
Enter summary (required): + read SUMMARY
runs a bash script in debugging mode
++ echo runs a bash script in debugging mode
++ cut -c1-154
+ SUMMARY='runs a bash script in debugging mode'
++ echo bash -x ./post_to_commandlinefu.sh
++ cut -c1-254
+ COMMAND='bash -x ./post_to_commandlinefu.sh'
+ echo 'post-data is command=bash -x ./post_to_commandlinefu.sh&summary=runs a bash script in debugging mode&submit=Save'
post-data is command=bash -x ./post_to_commandlinefu.sh&summary=runs a bash script in debugging mode&submit=Save
+ wget -O - --load-cookies ./.c --post-data 'command=bash -x ./post_to_commandlinefu.sh&summary=runs a bash script in debugging mode&submit=Save&' http://www.commandlinefu.com/commands/edit
+ rm -f browse edit
+ rm -f '*17274*'