The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

0
votes
2answers
154 views

sqlite fts quoting problem

I can do this in sqlite tool: sqlite> select caption from notes_fts where notes_fts MATCH '"perl install"'; but cannot from the Linux shell i.e., this fails: user@host:~$ sqlite3 sqldb ...
2
votes
1answer
797 views

How to switch PulseAudio inputs and outputs from command line?

At work I use to use an USB headset which gets detected as separate audio output and input (for the mic) devices. At home I use conventional analogue headset which is plugged into my laptop built-in ...
2
votes
1answer
445 views

RIPEMD-160 file digest

How can I make a file digest under Linux with the RIPEMD-160 hash function, from the command line?
8
votes
2answers
421 views

Command line input while a running script displays strange symbols

If I use the bash shell cli and run some program which doesn't return immediately, then I input some letters (basically typing the next command before noticing the previous didn't finish) and the ...
2
votes
3answers
205 views

How to echo (a (executable-)string) to the prompt, so that the cursor flashes at the end of the line?

How to echo (a (executable-)string) to the prompt to make the cursor sit at the end of the line? So that I can hit Enter to execute or Ctrl-C to throw away the line. Is this possible at all? I ...
3
votes
2answers
1k views

How do you configure the MTU for all network adapters via a script?

NOTE: This is for RHEL/centOS. Currently my way of configuring the MTU is via GUI using system-config-network and setting the MTU to 4096. I would like a non-interactive script to do this instead. ...
1
vote
1answer
293 views

How to make FreeBSD variant of cal start weeks on mondays?

Can week start day be changed in cal output? Is it hardcoded? Notice: not the ncal.
0
votes
1answer
264 views

rexecd daemon for Ubuntu

How to start rexecd daemon/server on ubuntu-11.10 ? If I try to run the command /usr/sbin/in.rexecd then an error appears as rexecd: getpeername: Socket operation on non-socket rexecd is remote ...
11
votes
9answers
3k views

Console Text Editor with Windows-like keyboard shortcuts (ctrl-z, x, c, v)

Ok, I realise that I risk a religious war asking a question about text editors, but here goes. Requirements Mostly used for config file edits Text based not GUI Available for Raspian flavour of ...
2
votes
1answer
3k views

How to Connect to Wireless Automatically? (Non-graphical)

I'm trying to set up my Arch Linux so that, through non-graphical means, I can connect to a wireless network through profiles on my system. I have tried net-auto-wireless, and it does everything I ...
3
votes
3answers
2k views

MySQL Linux Client Timeout/Keepalive

Is there a way to set a keepalive in the command-line MySQL client on Linux? Our network recently moved to a VLAN setup, and our systems department no longer has control of the firewall. The ...
10
votes
2answers
542 views

Highlight the three last updated files in ls output

Is there any way to overload or wrap the ls command so that it will highlight / underline / otherwise make obvious the last three modified files? I know that I can simply ls -rtl to order by reverse ...
3
votes
1answer
718 views

Command tool to create torrent files that includes MD5 hashes of files?

I'm aware of mktorrent, and know how to use it, but for testing purposes I require a utility that will also include the MD5 hash of every file in the torrent in the torrent meta info. I realize that ...
16
votes
1answer
10k views

How to remove a single line from history?

I'm working in Mac OSX, so I guess I'm using bash...? Sometimes I enter something that I don't want to be remembered in the history. How do I remove it?
1
vote
3answers
2k views

Reading from STDIN and using data immediatly (while still reading) or opening a URL with zbar

I need to read lines from STDIN and process them. I could do something like: <print lines to STDOUT> | while read line; do <process $line> done But this means that first all lines ...
35
votes
3answers
38k views

ssh-add complains: Could not open a connection to your authentication agent

I've been trying to get ssh-add working on a RaspberryPi running Raspbian. I can start ssh-agent, when I do it gives the following output into the terminal: ...
6
votes
3answers
3k views

How to revert chown command?

If I run: sudo chown -R user:user / Can I revert it to what it was before I ran it?
8
votes
3answers
2k views

How can I remove duplicates in my .bash_history, preserving order?

I really enjoying using control+r to recursively search my command history. I've found a few good options I like to use with it: # ignore duplicate commands, ignore commands starting with a space ...
15
votes
1answer
2k views

copy (to X clipboard) shortcut in .tmux.conf

In order to copy text to X clipboard in tmux, what I currently do is: go selection mode with prefix[ start selection with space (using mode-keys vi btw) select the text and press enter copy tmux ...
4
votes
3answers
871 views

How to tell of whether the kernel parameter [passed at command line] is a valid kernel parameter?

In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.: kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 plasticDuck After booting up a ...
9
votes
1answer
7k views

How to display kernel command line parameters?

In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.: kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 After booting a given kernel, is ...
21
votes
3answers
16k views

SSH inside SSH fails with “stdin: is not a tty”

I'm trying to connect to machine one with ssh and then connect to another machine two with ssh, but I get this error. ssh user@computerone.com 'ssh otheruser@computertwo.com' stdin: is not a tty ...
2
votes
1answer
2k views

Hold and release CUPS print jobs from command line

Is is possible to hold and release CUPS print jobs from command line? How to do it? I tried cupsenable: sudo cupsenable --release myprinter but it didn't work.
3
votes
1answer
2k views

Connect to hidden Wifi AP with wpa-supplicant?

I have a headless Debian machine, with a Wifi dongle connected. I used to hide the Wifi AP, but now I can't. If I unhide it, some lines in the /etc/network/interfaces will allow me to connect: auto ...
2
votes
1answer
127 views

Output redirection and spaces

I'm paranoid about this, but hopefully it's a simple question: Is there any difference between cat file1 | egrep -oP "[Mm]y string" > /home/user/file.txt and cat file1|egrep -oP "[Mm]y ...
2
votes
3answers
2k views

What's wrong with these two cron job's?

I have the following cron jobs defined. 55 8 * * 3 /usr/bin/php /home/mark/dev/processes/customClient/events.php > /home/mark/dev/processes/customClient/events-`date +%Y-%m-%d ...
55
votes
10answers
14k views

How to grep a specific line _and_ the first line of a file?

Assuming a simple grep such as: $ psa aux | grep someApp 1000 11634 51.2 0.1 32824 9112 pts/1 SN+ 13:24 7:49 someApp This provides much information, but as the first line of the ps ...
4
votes
3answers
634 views

id3v2 used recursively at command line?

Trying to get my id3 tags cleaned up and am loving id3v2 on the command line -- but I've been using it only with a *.mp3 wildcard and want to explore if there's a way to use it recursively so I can ...
9
votes
2answers
5k views

Is there a simple command for outputting tab-delimited columns in bash?

E.g. I have a file (produced with echo -e "var1\tvar2\t\var3\tvar4" > foo) that are output (in bash): $ cat foo case elems meshing nlsys uniform 2350 0.076662 2.78 non-conformal ...
8
votes
1answer
2k views

How do we specify multiple ignore patterns for `tree` command?

I need to print the directory structure of our production system and I would like to remove some specific directories from the tree? How do we specify multiple ignore patterns for tree command?
-1
votes
2answers
391 views

source script as command [closed]

For some reason (?), often when I write scripts nowadays they do not work, or work only in part, and then I try with . or source and they work perfectly. I'm unsure what is causing this as the scripts ...
2
votes
1answer
143 views

How to put “glue” CWD (etc.) to part of the screen instead of putting into PS1?

I suspect there’s some terminology for this question that I’m not aware of. It’s hard to check if a question has already been answered if one doesn’t know the proper vocabulary. So, sorry if this is ...
4
votes
3answers
348 views

Use command grep and locate

How I can make the grep command locate certain words in the files specified by the routes found by the locate command? locate my.cnf | grep user (I want that grep command search the word "user" ...
1
vote
1answer
76 views

Rebooting makes me lose my password-less keys on other machines

When I reboot my machine (as I did today) I seem to lose some functionality, specifically my previous ssh keys that I had copied over to other machines that had allowed me to login without a password ...
3
votes
4answers
3k views

Find only destination of symlink

For use in a shell-script, I'm looking for a commandline-way to get the destination of a symbolic link. The closest I've come so far is stat -N src, which outputs src -> dst. Of course I could ...
2
votes
2answers
480 views

Putting Linux processes on certain CPU cores [duplicate]

Possible Duplicate: How can I set the processor affinity of a process on Linux? Computer CPUs have many cores insde them nowadays. I have always wondered if there is a way to, when I start ...
2
votes
5answers
1k views

Need to grep file with specific letter and move to another folder linux

I need to select files which contain "Error" or "traffic" in their names, e.g. abc_ERRor.csv raError.csv bsn_Error.csv bbbctraffic.csv ccc_traffic.csv ... and move them into corresponding ...
0
votes
2answers
200 views

Total RAM used by a program with `ps`? [duplicate]

Possible Duplicate: Measuring RAM usage of a program I am trying to use ps to benchmark a program, I'm just not sure which flags to use. I would like to get the amount of RAM the program ...
3
votes
1answer
109 views

Can I force myself to enter a password when run certain processes?

I frequently work in an environment where, lets call them "pranksters" may gain access to my console. I am diligent in locking my screen whenever I walk away, but given enough time someone gets the ...
2
votes
1answer
565 views

Regarding generating intersection and union of two csv files

I have two csv files, there are some overlap columns between these two files. Assume one file is called as A.csv and another is called as B.csv. The intersection of A and B is called as C. I would ...
1
vote
1answer
8k views

access external hard drive to delete folder on terminal Mac

I want to delete a folder of portable hard drive on terminal in Mac. Are there any command line ?
3
votes
2answers
432 views

Urxvt draws lines slowly

I'm using Arch Linux and Urxvt as terminal emulator. When I scroll up/down, text lines gets rendered so slow I can count by top to bottom (heh, 1st line get rendered... ohh, 2nd one! ...). It takes ...
3
votes
2answers
1k views

CentOS: Install packages listed in a text file?

I have an existing CentOS installation which I'd like to install extra packages to. The packages to be installed were supplied to me in a list, one package per line, which looks like: .... ...
3
votes
1answer
380 views

Extract directory from wget's stdout

I am trying to wget a tarball from github.com and, without creating a temporary file, extract a subdirectory from it: wget -qO- https://github.com/django-nonrel/django-nonrel/tarball/develop | tar ...
3
votes
3answers
536 views

Fastest way to open all files in a directory with multiple file extensions on commandline

If I want to open all mp4 files in a directory, I can simply do something like totem *.mp4. But how can I open all mp4 and all flv files in that directory with one command. I.e. I want to do something ...
6
votes
1answer
1k views

How to mount a Truecrypt container with a timeout from the command line?

I'm mounting a truecrypt container via the command line (i.e. truecrypt file dir). Is there any way to have truecrypt automatically unmount the container after a given amount of inactivity in dir?
16
votes
4answers
7k views

How to Execute multiple command using nohup

I want to execute multiple command using nohup, And each command should execute after previous command, I used this command for example: nohup wget $url && wget $url2 > /dev/null ...
2
votes
1answer
195 views

Standard command line syntax ambigiuty in interpretation rules?

This question is somewhat similar to this: Unix/Linux command syntax Suppose I have a program foo that takes arguments -a and -b. If both a and b take a string argument what is the meaning of this ...
9
votes
3answers
295 views

How can my script know when I'm in a virtual console vs. an xterm?

A few of my scripts (keymap changing, public key adding) need to act differently when in a virtual console vs. in an xterm. What's the real code for #!/bin/ksh if [[ in_a_virtual_console ]]; then ...
4
votes
3answers
1k views

Automate login with sudo and su

I know the security risks, but I am performing this experiment/exercise on an old, seldom used *nix machine I have laying around the house. So doing this exercise will not bring any security risk to ...