Commands tagged archlinux (10)

  • This one-liner will output installed packages sorted by size in Kilobytes. Show Sample Output


    4
    paste <(pacman -Q | awk '{ print $1; }' | xargs pacman -Qi | grep 'Size' | awk '{ print $4$5; }') <(pacman -Q | awk '{print $1; }') | sort -n | column -t
    BruceLEET · 2011-01-07 18:43:18 7
  • -Qdt Lists dependencies/packages which are no longer required by any packages -q Output only package name (not the version number) -R Remove package(s) Rest is self-explanatory. I just started out with Arch - so if there is any better/standard method to achieve the same - please suggest.


    4
    pacman -Qdt -q | xargs pacman --noconfirm -R
    b_t · 2014-02-27 05:17:57 8
  • uses the pkgfile command (part of the community repository), highly suggested.


    1
    pkgfile -lb `pkgfile <command>`
    infinull · 2010-10-01 04:54:49 4
  • Sometimes when I find a new cool command I want to know: 1.- which package owns it, and 2.- are there any other cool commands provided by this package? Since I don't necessarily need to know always both, I don't use this version, but I bundle it into two separate functions: # get command package owner # it can work without the full path, but sometimes fails, so better to provide it with whereis command owner () { pacman -Qo `whereis $1 | awk '{print $2}'` } whatelse () { package=`owner ${1} | sed -e 's/.*is owned by \([[:alpha:]]\+\).*/\1/'` pacman -Ql $package | grep 'bin' } Show Sample Output


    0
    w=`whereis <command> | awk '{print $2}'`; p=`pacman -Qo $w | sed -e 's/.*is owned by \([[:alpha:]]\+\).*/\1/'`; pacman -Ql $p | grep 'bin'
    conan · 2010-10-01 04:28:04 3

  • 0
    pacman -Qi $(pacman -Qq)|grep 'Name\|Size'| cut -d: -f2 | paste - - | column -t | sort -nk2
    minus · 2011-05-03 13:02:06 4
  • M is size in megabytes, man expac to see other sizes %m is install size %k is download size


    0
    expac -S -H M "%m %n"|sort -n
    gtmanfred · 2012-06-14 19:41:21 3
  • In this example I am returning all the files in /usr/bin that weren't put there by pacman, so that they can be moved to /usr/local/bin where they (most likely) belong. Show Sample Output


    0
    for file in /usr/bin/*; do pacman -Qo "$file" &> /dev/null || echo "$file"; done
    malathion · 2014-04-22 21:57:08 11
  • This version accounts for the MiB/KiB suffix output by pacman these days.


    0
    pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | paste - - - | awk -F'\t' 'BEGIN{ s["MiB"]=1024; s["KiB"]=1;} {split($3, a, " "); print a[1] * s[a[2]], "KiB", $1}' | sort -n
    Timo · 2018-04-24 13:29:57 150

  • 0
    echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/dev/x86_64" | sudo tee -a /etc/pacman.conf
    HaoZeke · 2018-08-13 07:30:55 298
  • This, like the other commands listed here, displays installed arch packages. Unlike the other ones this also displays the short description so you can see what that package does without having to go to google. It also shows the largest packages on top. You can optionally pipe this through head to display an arbitrary number of the largest packages installed (e.g. ... | head -30 # for the largest 30 packages installed) Show Sample Output


    -1
    pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | paste - - - | awk -F'\t' '{ print $2, "\t", $1, "\t", $3 }' | sort -rn
    GetterNoCheddar · 2012-11-20 03:40:55 8

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Show top committers for SVN repositority for today

Write a shell script that removes files that contain a string
Deletes files in the current directory or its subdirectories that match "regexp" but handle directories, newlines, spaces, and other funky characters better than the original #13315. Also uses grep's "-q" to be quiet and quit at the first match, making this much faster. No need for awk either.

Stream YouTube URL directly to mplayer.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Delicious search with human readable output
You can install filterous with $ sudo apt-get install libxslt1-dev; sudo easy_install -U filterous

list block devices
Shows all block devices in a tree with descruptions of what they are.

Notify me when users log in
Notifyme is a program that listen in background for users login, and report on login and logout. Users can be specified from a list or in a ~/notify.rc file. -C options force to display messages on the center of the screen.See man notifyme for more details. Part of notifyme package, tested on Debian.

Display usb power mode on all devices

hard disk information - Model/serial no.
Get the hard disk information with out shutting down and opening the system. It gives information on model no., serial no., cylinders/heads/sectors, and the supported features of the hard disk.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: