Skip to content

Instantly share code, notes, and snippets.

@rolandovillca
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolandovillca/8a19d780561ec0e89a5d to your computer and use it in GitHub Desktop.
Save rolandovillca/8a19d780561ec0e89a5d to your computer and use it in GitHub Desktop.
UBUNTU COMMANDS V2
# AVOID SUDO PASSWORD:
# sudo: no tty present and no askpass program specified
$ sudo visudo
$ my_slave_user ALL=(ALL) NOPASSWD: ALL
# FORMATING A PENDRIVE:
# To show all the volume in your pc
sudo fdisk -l
# To see the usb flash drive suppose it may be /deb/sdb1
$ df
$ lsblk
# Un mount the drive
$ sudo umount /dev/sdb1
# To format drive into fat32 format
$ sudo mkfs.vfat /dev/sdb1
# CAT:
# $ cat > test.txt << end
# GREP: Use grep to find text in cached results:
$ ps -ax | grep mongo
$ sudo netstat -tapen | grep ":4444 "
$ ps -ef | grep node
$ killall node
$ ps -ef | grep -i selenium | grep -v grep | awk '{print $52}'
# GREP: Use grep to find text within files recursively directory:
$ grep -Rin "string to search for" /path/to/directory
# FIND: Use "find" command to find filenames:
$ find /directory/path/to/search -name "filename.*"
$ sudo find . -name 'filename'
$ sudo find . -print | grep -i 'filename'
$ ls -R | grep '.*[.]xml'
$ ls * | grep "discovery_storage.py"
# TAIL:
$ tail access.log error.log
$ tail -5 access.log
$ tail -c5 access.log # number of characters
# HEAD:
$ head /etc/passwd /etc/shadow
$ head -n5 /var/log/yum.log
$ head -5 /var/log/yum.log
$ head -c45 /var/log/yum.log #display the first 45 bytes of given file
# TO DELETE OLD SSH KEYS:
# $ ssh-keygen -f "/home/>user_name>/.ssh/known_hosts" -R <ip_destiny>
$ ssh-keygen -f "/home/juan_perez/.ssh/known_hosts" -R 10.0.0.12
# HOW TO INSTALL ECLIPSE
1. Download eclipse
2. Copy and uncompress .tar.gz file to /opt/ directory
$ cd /opt/ && sudo tar -zxvf ~/Downloads/eclipse-*.tar.gz
3. Create launcher shortcut for eclipse:
$ sudo gedit /usr/share/applications/eclipse.desktop
4. Paste below content into the opened file and save it.
[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
5. Ready to use it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment