Commands by quitaiskiluisf (7)

  • This commando copies the file (which must reside in the current directory) to //<server>/<share-name>/<subdirectory>/<file> through the CIFS protocol (Samba share or Windows Share). It doesn't require you to mount the filesystem first. --directory "<subdirectory>" may be omitted in order to copy the file the the root of the share. The "%password" part may also be omitted. If doing so, smbclient will ask for the password interactively. To copy a file from a Windows/Samba share, change "put" for "get". smbclient --user=user%password --directory "&lt;subdirectory&gt;" --command "get &lt;file&gt;" //&lt;server&gt;/&lt;share-name&gt; Show Sample Output


    2
    smbclient --user=user%password --directory "<subdirectory>" --command "put <file>" //<server>/<share-name>
    quitaiskiluisf · 2018-05-12 19:18:42 154
  • When the wireless card is in AP mode, list the users which are connected to the network. It uses the new nl80211 based CLI configuration utility for wireless devices. It can be used, for example, in a dd-wrt based router through a telnet session to obtain client information. Show Sample Output


    0
    iw dev ath0 station dump
    quitaiskiluisf · 2017-01-09 00:50:49 16
  • After cloning an empty repository on the client ("git clone" just after "git init", for instance), "git push" fails. In order to be able to push to this repository for the first time, you need to run the above command. It will link your local "master" branch to the "master" branch in the origin server, and push the changes. This is only necessary only for the first push; after that, you can use just the commands "git push" or "git pull" in order to do this operations. Show Sample Output


    -1
    git push --set-upstream origin master
    quitaiskiluisf · 2017-01-09 00:32:14 23
  • When the wireless card is in AP mode, list the users which are connected to the network. Show Sample Output


    0
    wlanconfig <wireless_device> list sta
    quitaiskiluisf · 2013-06-08 13:46:51 20
  • This command will disconnect the user whose mac was specified from the current list of clients from the wireless network when the network card is working in access point mode. Works on atheros-based access points which use the madwifi driver (not sure, but don't think it will work on access points which are not atheros-based, as it uses the atheros's iwpriv extensions). It will not prevent the user from reconnecting to the network, but may force the user to roam to another AP, with stronger signal. Show Sample Output


    1
    iwpriv ath<x> kickmac <macaddress>
    quitaiskiluisf · 2013-06-08 13:41:24 7
  • Create an image of "device" and send it to another machine through the network ("target" and "port" sets the ip and port the stream will be sent to), outputting a progress bar On the machine that will receive, compress and store the file, use: nc -l -p <port> | 7z a <filename> -si -m0=lzma2 -mx=9 -ms=on Optionally, add the -v4g switch at the end of the line in order to split the file every 4 gigabytes (or set another size: accepted suffixes are k, m and g). The file will be compressed using 7z format, lzma2 algorithm, with maximum compression level and solid file activated. The compression stage will be executed on the machine which will store the image. It was planned this way because the processor on that machine was faster, and being on a gigabit network, transfering the uncompressed image wasn't much of a problem.


    8
    dd if=<device> | pv | nc <target> <port>
    quitaiskiluisf · 2012-01-27 18:37:36 18

  • 0
    mplayer -vc null -vo null -ao pcm <filename>
    quitaiskiluisf · 2011-09-11 04:03:02 3

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: