
Terminal - Commands using cut - 407 results
tail -f /var/log/messages.log | while read line ; do echo $line | cut -d \ -f5- | sed s/\\[[0-9]*\\]// | espeak ; done
This is sample output - yours may be different.
dpkg --list | rgrep ii | cut -d" " -f3 | sed ':a;N;$!ba;s/\n/ /g' | sed 's/^\(.\)/apt-get install \1/'
This is sample output - yours may be different.
apt-get install acl adduser anthy-common apt apt-utils aptitude authbind avahi-daemon base-files base-passwd bash bind9-host binutils bsdmainutils bsdutils busybox bzip2 ca-certificates ca-certificates-java collectd collectd-core coreutils cpio cpp cpp-4.4 cron curl dash dbus debconf debconf-i18n debian-archive-keyring debianutils deborphan defoma dhcpcd dialog diffutils dmidecode dmsetup dnsutils dpkg dstat e2fslibs e2fsprogs emacs emacs23 emacs23-bin-common emacs23-common emacsen-common fancontrol file findutils firmware-linux-free fontconfig fontconfig-config fping gcc gcc-4.4 gcc-4.4-base gconf2-common geoip-database gettext-base gnupg gpgv grep groff-base grub grub-common grub-pc gsfonts gsfonts-x11 gzip hicolor-icon-theme hostname htop ifupdown info initramfs-tools initscripts insserv install-info iproute iptables iputils-ping java-common joe klibc-utils less lftp libaccess-bridge-java libaccess-bridge-java-jni libacl1 libanthy0 libasound2 libasyncns0 libatk1.0-0 libatk1.0-data libattr1 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libbind9-60 libblkid1 libboost-iostreams1.42.0 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc6 libc6-dev libcairo2 libcap-ng0 libcap2 libcomerr2 libcommons-collections3-java libcommons-dbcp-java libcommons-pool-java libcroco3 libcups2 libcurl3 libcurl3-gnutls libcurses-perl libcurses-ui-perl libcwidget3 libdaemon0 libdatrie1 libdb4.7 libdb4.8 libdbi0 libdbi1 libdbus-1-3 libdbus-glib-1-2 libdevmapper1.02.1 libdns69 libecj-java libedit2 libept1 libesmtp6 libevtlog0 libexpat1 libflac8 libfont-freetype-perl libfontconfig1 libfontenc1 libfreetype6 libfribidi0 libgcc1 libgconf2-4 libgcrypt11 libgd2-noxpm libgdbm3 libgeoip1 libgif4 libglib2.0-0 libglib2.0-data libgmp3c2 libgnutls26 libgomp1 libgpg-error0 libgpm2 libgsf-1-114 libgsf-1-common libgssapi-krb5-2 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libhal1 libice-dev libice6 libidl0 libidn11 libisc62 libisccc60 libisccfg62 libjasper1 libjpeg62 libk5crypto3 libkeyutils1 libklibc libkrb5-3 libkrb5support0 liblcms1 libldap-2.4-2 liblocale-gettext-perl liblockfile1 libltdl7 liblua5.1-0 liblwres60 liblzma2 libm17n-0 libmagic1 libmemcached10 libmodbus5 libmpfr4 libmysqlclient16 libncurses5 libncursesw5 libnet-snmp-perl libnet1 libnewt0.52 libnfnetlink0 libnl1 libnspr4-0d libnss-mdns
curl -s mi-ip.net | grep '"ip"' | cut -f2 -d ">" | egrep -o '[0-9.]+'
This is sample output - yours may be different.
looks at html for "ip" (it's a CSS class), then a little of cut and egrep to get IPv4 address.
I use this oneliner into conky.
find . \( -iname '*.cpp' -o -iname '*.h' \) -exec wc -l {} \; | sort -n | cut --delimiter=. -f 1 | awk '{s+=$1} END {print s}'
This is sample output - yours may be different.
Searches for *.cpp and *.h in directory structure, counts the number of lines for each matching file and adds the counts together.
lpstat -p | cut -d' ' -f2 | xargs -I{} lpadmin -x {}
This is sample output - yours may be different.
This is the closest you can get to "reset printing system" from the command line. Giving credit back to J D McIninch from an apple forum back in 2009.
echo $(find <directory> -name '*.<extension>' -exec du -s {} \; | tee $(tty) | cut -f1 | tr '\n' '+') 0 | bc
This is sample output - yours may be different.
Also shows files as they are found. Only works from a tty.
getent passwd | cut -d: -f1 | sort
This is sample output - yours may be different.
lynx -useragent=Opera -dump 'http://www.facebook.com/ajax/typeahead_friends.php?u=521826202&__a=1' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2
This is sample output - yours may be different.
lynx -useragent=Opera -dump 'http://www.facebook.com/ajax/typeahead_friends.php?u=4&__a=1' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2
This is sample output - yours may be different.
lynx -useragent=Opera -dump 'http://www.facebook.com/ajax/typeahead_friends.php?u=100000475200812&__a=1' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2
This is sample output - yours may be different.
cut -c23-37 /var/log/squid3/access.log | cut -d' ' -f1 | sort | uniq
This is sample output - yours may be different.
Generates the list of clients (IPs addresses) that have used the Squid webproxy according to the most recent log. Every IP appears only once in the list.
lsmod | tail -n +2 | cut -d' ' -f1 | xargs modinfo | egrep '^file|^desc|^dep' | sed -e'/^dep/s/$/\n/g'
This is sample output - yours may be different.
asterisk -rx "core show calls" | grep "active" | cut -d' ' -f1
This is sample output - yours may be different.
buf () { oldname=$1; if [ "$oldname" != "" ]; then datepart="$(date +%Y-%m-%d).bak"; firstpart=`echo $oldname | cut -d "." -f 1`; newname=`echo $oldname | sed s/$firstpart/$firstpart.$datepart/`; cp -iv ${oldname} ${newname}; fi }
This is sample output - yours may be different.
Appends the input file with the date format YYYY-MM-DD.bak. Also runs silently if you remove the -v on the cp at the end of the function.
nmap -n -sP -oG - 10.10.10.*/32 | grep ": Up" | cut -d' ' -f2
This is sample output - yours may be different.
10.10.10.2
10.10.10.4
10.10.10.20
10.10.10.130
10.10.10.200
10.10.10.254
You can substitute 10.10.10.* by your own network. Or whatever nmap accepts, inlcluding submask.
ssh-keygen -l -f [pubkey] | cut -d ' ' -f 2 | tr -ds '\n:' ''
This is sample output - yours may be different.
eselect bashcomp enable --global $(eselect bashcomp list | sed -e 's/ //g'| cut -d']' -f2 | sed -e 's/\*//'| xargs)
This is sample output - yours may be different.
curl -s http://checkrealip.com/ | grep "Current IP Address" | cut -d ' ' -f 4
This is sample output - yours may be different.
ip a s eth0 | grep "inet " | head -n 1 | awk '{print $2}' | cut -f1 -d'/'
This is sample output - yours may be different.
Get the first IPv4 address of an interface
ifconfig | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1
This is sample output - yours may be different.
for user in $(getent passwd|cut -f1 -d:); do echo "### Crontabs for $user ####"; crontab -u $user -l; done
This is sample output - yours may be different.
added echo "### Crontabs for $user ####"; to make clear whose crontab is listed.
for user in $(cut -f1 -d: /etc/passwd); do echo "### Crontabs for $user ####"; crontab -u $user -l; done
This is sample output - yours may be different.
added echo "### Crontabs for $user ####"; to make clear whose crontab is listed.
smbclient -N -gL \\SambaServer 2>&1 | grep -e "Disk|" | cut -d'|' -f2
This is sample output - yours may be different.
This is sample output - yours may be different.
Emma Thomas
Alex Jason
Madison Randy
Sanjay Gupta
Nisha Singh
Display the 1st field (employee name) from a colon delimited file
netstat -tn | grep :80 | awk '{print $5}'| grep -v ':80' | cut -f1 -d: |cut -f1,2,3 -d. | sort | uniq -c| sort -n
This is sample output - yours may be different.
1 192.168.1.5
5 192.168.1.2
8 192.168.1.52
15 192.168.1.3
19 192.168.1.30
cut -f1,2 - IP range 16
cut -f1,2,3 - IP range 24
cut -f1,2,3,4 - IP range 24