Quantcast
Channel: Commands using xargs sorted by votes
Browsing all 98 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Get user's full name in Mac OS X

$ finger $(whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | xargs echo Its possible to user a simple regex to extract de username from the finger command. The final echo its optional,...

View Article



Image may be NSFW.
Clik here to view.

find xargs mv

$ find . -iname "*.mp4" -print0 | xargs -0 mv --verbose -t /media/backup/ View this command to comment, vote or add to favourites View all commands by hochmeister Diff your entire server config at...

View Article

Image may be NSFW.
Clik here to view.

Install every (not already installed) component of the Google Cloud SDK

$ gcloud components list | grep "^| Not" | sed "s/|\(.*\)|\(.*\)|\(.*\)|/\2/" | xargs echo gcloud components update Google Cloud SDK comes with a package manager `gcloud components` but it needs a bit...

View Article

Image may be NSFW.
Clik here to view.

Find Duplicate Files (based on size first, then MD5 hash)

$ find -not -empty -type f -printf "%-30s'\t\"%h/%f\"\n" | sort -rn -t$'\t' | uniq -w30 -D | cut -f 2 -d $'\t' | xargs md5sum | sort | uniq -w32 --all-repeated=separate Finds duplicates based on MD5...

View Article

Image may be NSFW.
Clik here to view.

Find class in jar

$ find . -name '*.jar' | xargs -l jar vtf | grep XXX.java View this command to comment, vote or add to favourites View all commands by zluyuer Diff your entire server config at ScriptRock.com

View Article


Image may be NSFW.
Clik here to view.

Git fetch all remote branches

$ git branch -r | awk -F'/' '{print "git fetch "$1,$2}' | xargs -I {} sh -c {} View this command to comment, vote or add to favourites View all commands by cakyus Diff your entire server config at...

View Article

Image may be NSFW.
Clik here to view.

optimize all png images

$ find . -name *.png | xargs optipng -nc -nb -o7 -full View this command to comment, vote or add to favourites View all commands by homoludens Diff your entire server config at ScriptRock.com

View Article

Image may be NSFW.
Clik here to view.

convert png images to jpg and optimize them

$ ls *.png | cut -d . -f 1 | xargs -L1 -i convert -strip -interlace Plane -quality 80 {}.png {}.jpg View this command to comment, vote or add to favourites View all commands by homoludens Diff your...

View Article


Image may be NSFW.
Clik here to view.

Upgrade all expired homebrew packages

$ brew outdated | cut -f1 | xargs brew upgrade You probably want to run `brew update` before you run this command View this command to comment, vote or add to favourites View all commands by wires Diff...

View Article


Image may be NSFW.
Clik here to view.

Upgrade pip-installed python packages

$ python -c "import pip; print(' '.join([x.project_name for x in pip.get_installed_distributions()]))" | xargs sudo pip install -U View this command to comment, vote or add to favourites View all...

View Article

Image may be NSFW.
Clik here to view.

Move all located items to folder

$ locate -0 -i *barthes* | xargs -0 mv -t ~/'Library/Books/Barthes, Roland' Find all books on my systems and move them into folder. The -0 switches are to handle spaces etc. in the filenames. Why would...

View Article

Image may be NSFW.
Clik here to view.

count all the lines of code in a directory recursively

$ find . -name '*.php' | xargs wc -l count all the lines of code in specific directory recursively in this case only *.php can be *.* View this command to comment, vote or add to favourites View all...

View Article

Image may be NSFW.
Clik here to view.

Delete all local git branches that have been merged

$ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d This checks if the branch has been merged with master and then will delete the ones that have been. Keeps your local git repo nice and...

View Article


Image may be NSFW.
Clik here to view.

Find which fibre HBA a disk is connected to

$ udevadm info -q all -n /dev/sdc | grep ID_PATH | cut -d'-' -f 2 | xargs -n 1 lspci -s Useful for big systems with lots of cards. (Update: does not work with USB disks) View this command to comment,...

View Article

Image may be NSFW.
Clik here to view.

Find the date of the first commit in a git repository

$ git rev-list --all|tail -n1|xargs git show|grep -v diff|head -n1|cut -f1-3 -d' ' Finds the date of the first commit in a git repository branch View this command to comment, vote or add to favourites...

View Article


Image may be NSFW.
Clik here to view.

Find the date of the first commit in a git repository

$ git rev-list --all|tail -n1|xargs git show|grep -v diff|head -n1|cut -f1-3 -d' ' Finds the date of the first commit in a git repository branch View this command to comment, vote or add to favourites...

View Article

Image may be NSFW.
Clik here to view.

Find common groups between two users

$ groups user1 user2|cut -d: -f2|xargs -n1|sort|uniq -d Updated according to flatcap's suggestion, thanks! View this command to comment, vote or add to favourites View all commands by swemarx Diff your...

View Article


Image may be NSFW.
Clik here to view.

draw rhomb

$ a=$(b=$(($LINES/2));f() { for c in $(seq $b); do for i in $(seq $c);do echo x;done|xargs echo;done };paste <(f) <(f|tac|tr 'x' '-') <(f|tac|tr 'x' '-') <(f)|tr '\t' ' ');(cat...

View Article

Image may be NSFW.
Clik here to view.

Export MySQL tables that begin with a string

$ sudo mysql -sNe 'show tables like "PREFIX_%"' DBNAME | xargs sudo mysqldump DBNAME > /tmp/dump.sql View this command to comment, vote or add to favourites View all commands by shadyvb Diff your...

View Article

Image may be NSFW.
Clik here to view.

Download all manuals RedHat 7 (CentOS/Fedora) with one command in Linux

$ wget -q -O- https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/ | grep Linux/7/pdf | cut -d \" -f 2 | awk '{print "https://access.redhat.com"$1}' | xargs wget View this command to...

View Article
Browsing all 98 articles
Browse latest View live


Latest Images