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

learn more… | top users | synonyms (1)

1
vote
0answers
7 views

Program like vnStat that filters for only external (Internet) traffic

I've been using vnStat to monitor the ethernet interface on a Linux computer, but found that it includes all local traffic. I do many file transfers from within the subnet which far exceeds the ...
1
vote
1answer
16 views

How to change configuration of detox (dash instead underscore)?

I found, best to this moment, a solution when changing all those annoying filenames in large quantities, making them readable and easier to manipulate with in command-line. So I found, among many ...
2
votes
1answer
18 views

Updatedb unrecognized option '--localpaths='

I am attempting to update a single directory I created. I'm using updatedb so it will be found by the locate command. Command used: updatedb ...
-1
votes
0answers
18 views

useradd -c “Text” username does not work when reading data from a file [on hold]

useradd -c "text" username works only from within a script when parameters are passed to the script on the command line, but when the parameters are read from a file, it doesn't work
3
votes
0answers
17 views

Can't login via telnet in ddwrt

I have a Gateworks laguna 2388 router with dd-wrt firmware installed in it. It was working fine till i change "http_passwd" nvram attribute. I wanted to change the web GUI password via telnet. So I ...
0
votes
0answers
18 views

Create complex installation script for Linux (Centos)

For deployment of a complex system I would like to create a script that runs all compilations and set up. I am looking for an existing product that interpret installation scenario and performs all ...
1
vote
2answers
48 views

How to redirect output from file to stdout?

I'd like to rip the titles from a bunch of word documents. All the CLI tools I've tried for converting .doc to text lose the title... but Abiword's conversion to RTF preserves it, eg: $ abiword ...
4
votes
4answers
204 views

Make tail not modify the charset of the terminal

In a linux terminal (CentOS) I am using the command tail --follow=name my-rolling-file.log in order to see the logs of my application. Sometimes in the log there is some binary data dumped (I dump ...
0
votes
2answers
31 views

Auto Delete Inactive files after x

Is there a way I could delete certain folders after x amount of days of inactivity? I was thinking of using cron but that wouldn't take the inactivity part into consideration. Is there any Debian ...
1
vote
3answers
90 views

Bash long string, no word splitting?

I want to tidy up some script with long commands, so that for example: { somecheck || somecomand "reallyreallyreallyreallyreallyreallylongstring" } &> /dev/null & becomes something like: ...
4
votes
2answers
72 views

Expand wild cards in command before executing it

Suppose I want to type something like this: rm build/* tmp/* I am about to run it but I want to expand the wildcards before executing so I can verify what is about to happen. How can I do this? ...
0
votes
3answers
40 views

is it possible to create a macro-like user defined shell command?

Is it possible to run a single shortened command that would in turn initiate multiple longer to type commands? for instance, $ kontact & rekonq when passed to my terminal opens two ...
0
votes
1answer
30 views

how to open sets of programs simultaneously with command line

I recently learned here how to open a program from the command line. my question is, how can i make a set of programs open simultaneously with one command entered?
3
votes
1answer
121 views

Initiating programs from command line

Silly question, but hopefully some easy rep for someone. I am new to the linux/open source community, and I find it very feature rich, but often confusing. I am trying to configure a speedy ...
0
votes
1answer
48 views

-bash: auto: command not found

I'm going to config my network interfaces and run this command: auto eth0 but it returns -bash: auto: command not found. It seems I've missed something which I don't know. Any idea? What should I ...
1
vote
1answer
65 views

Running every command through another

I'm setting up a system in which any external command that does something with real effect must be crypthographically signed before before the system will execute them. The restrictions are in place ...
1
vote
0answers
42 views

Can't run php cli at webuser but will run as root

I am running a Magento application on a Nginx server. nginx + php-fpm running as webuser:www There are some function in the shell directory of Magento which run fine as root and the import run fine ...
-1
votes
1answer
41 views

Replace mutiple strings with different values in a file using unix [duplicate]

I have a file in which the data is like below, 01,0000000,xxxxxxx/ 02,xxxxxxxx,yyyyyy/ 03,test1,41203016,,/ 01,0000000,xxxxxxx/ ...
0
votes
1answer
33 views

What is the email matching regex in basic regex for grep?

I created a text file and put some email addresses in it. Then I used grep to find them. Indeed it worked: # pattern="^[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-z]{2,}" # grep -E $pattern regexfile but only as ...
1
vote
2answers
34 views

Merge lines in file together from regex to “lineify” multiline log log files

Stadard unix command line tools (grep, cut, sed etc.) all work one line at a time. And nearly always, this is great. However I am trying to parse some postgresql slow query logs. Each entry has some ...
1
vote
1answer
44 views

How to copy a directory with only specified type of files?

I got a git directory with plenty of python files(and some special file like .git). I'd like to copy only these python files to another directory with the directory structure unchanged. How to do ...
0
votes
0answers
21 views

command line tool group chat utility under linux

I am working on mac osx Yosemite. I want to reach to a user under a certain IP address. (It might be local network or thru internet). I want to do it thru terminal using the default tools that ...
1
vote
1answer
40 views

cfdisk or fdisk?

While reading the man page for fdisk I came across this interesting text: There are several *fdisk programs around. Each has its problems and strengths. Try them in the order ...
9
votes
2answers
257 views

How to access the second argument from the last command in the history ?

I am starting to learn some Regex, therefore I use this command repeatedly: grep pattern /usr/share/dict/american-english Only the part with pattern changes, so I have to write the long expression ...
0
votes
1answer
28 views

How to shutdown Linux parted magic from terminal?

Once in a while I have to use parted magic to restore superblocks. I tried to execute in the terminal: shutdown -h now telinit 0 Both did not work, what else might be possible to shutdown Linux via ...
17
votes
2answers
2k views

How did this '&' at the end of my command, make the script SO fast?

While solving some CTF challenges online, I came across a situation where I needed to bruteforce a server. This is the code I wrote: #!/bin/bash for i in {0..9}{0..9}{0..9}{0..9} do echo ...
2
votes
2answers
64 views

Can I recover my .bash_profile from an open Terminal tab?

I'm actually using a Macbook Pro, and am quite new to non-Windows OS' (I know, for shame!), and I've made the mistake of overwriting my bash profile, instead of appending to it... (n00b!). What I do ...
2
votes
1answer
59 views

how to get the full command line args passed to a process on unix/linux systems? [duplicate]

I am looking for a reliable way to get the full command line args passed to a process even when these are very long. I do know about ps -f -p <pid> and /proc/<pid>/cmdline, both of which ...
1
vote
3answers
129 views

How to perform grep onto the output of ldd properly ?

# ldd /usr/bin/ffmpeg linux-vdso.so.1 => (0x00007ffffc1fe000) libavfilter.so.0 => not found libpostproc.so.51 => not found libswscale.so.0 => not found ...
2
votes
1answer
41 views

How to tell xargs which argument to choose ? [duplicate]

When xargs redirects the first commands output into the second command's argument and there is no choice about which argument for which element of the output, then there is only one way, for instance: ...
0
votes
1answer
19 views

How to reduce the size of an mpeg file using the command line ?

I have a file, the output of the file command displays: jeff_western2.mp4: ISO Media, MPEG v4 system, version 1 I do not know how to lookup the resolution but it looks quiet high, the file itself ...
2
votes
0answers
43 views

Is it possible to show the current history line number when performing reverse search in bash?

Pressing Ctrl+R and typing py results in: (reverse-i-search) `py´: python I would like it to be this way: (reverse-i-search) `py´: n python where n is the history line number. I did not find an ...
0
votes
2answers
46 views

Get all hardisk list (/dev/sd*)Using command line

I need to get all the hardisk connected to my PC like, /dev/sda /dev/sdb /dev/sdc later I have to use it in script and monitor using iostat I alrady found fdisk command, it seems to be hard ...
2
votes
6answers
137 views

Join lines of text with repeated beginning

I have a long text file (a tab-file for stardict-editor) which consists of lines in the following format: word1 some text word1 some other text word2 more text word3 even more and would like to ...
1
vote
1answer
46 views

How to distinguish between output of numerous similar commands

Say I am issuing ls -la in a directory that has hundreds if not thousands of files, then changing to another directions and issuing ls -la. I then need to scroll up to see what files are in the most ...
1
vote
1answer
38 views

Is it possible to establish a Socket session (between Server and Client) using shell commands ?

From what I read (only the very outline, i do not know C Language) a Socket session is established between a server and a client by calling functions for both of them in a certain order. It starts ...
7
votes
1answer
305 views

In which situations are PS2, PS3, PS4 used as the prompt?

When I log on into the shell I see the prompt whose value is stored in PS1. I also encountereded another prompt (but do not know which one) when I used the here-document syntax: bc << HERE ...
3
votes
5answers
286 views

How to grep the n-th substring between given delimiters?

Let's say we have a string and its delimiter is ?: Leslie Cheung April 1 ? Elvis August 16 ? Leonard Nimoy February 27 I know how to grep the first substring between delimiters: echo $above_string ...
2
votes
2answers
39 views

Is it possible to change the PS1 periodically by a script in the background?

I just came across the PS1 variable (so I am far from being an expert). It is possible to change the prompt by simply changing this variables value, for instance: PS1="\h" hostname as Prompt PS1="\j" ...
2
votes
2answers
46 views

How can I select and copy file names in the command line without using the mouse?

Typically, when I want to perform an action on a file I discovered in the terminal after calling [ls], I would have to - with my mouse - highlight, left click, copy file name, type the command in then ...
4
votes
3answers
154 views

Get last part of string after hyphen

Is there a simple command line to extract the last part of a string separated by hyphens? E.g., I want to extract 123 from foo-bar-123.
16
votes
4answers
584 views

How can I implement a circular flow of data among interconnected commands?

I know of two types how commands can be connected with each other: by using a Pipe (putting std-output into std-input of the next command). by using a Tee (splice the output into many ...
2
votes
1answer
36 views

Need to press enter to get prompt after executing udev script

I have set a simple udev rule for my Raspberry Pi (Debian) to automatically mount an USB HDD. It just runs a script which mounts all devices in /etc/fstab since it's the only one I have and I'm going ...
2
votes
0answers
42 views

Bash: “history number” vs “command number”

While Googling how to customize my shell prompt via the PS1 variable, I'm seeing tables of special characters that can be used. In particular: \! the history number of this command ...
0
votes
1answer
63 views

How can I translate in the CLI an English word into a German one?

I want to write a Script that picks a random English word from /usr/share/dict/words, translates it into German, display both of them for a certain amount of time and repeat the process. I only know ...
1
vote
1answer
24 views

How to exclude the folders proc and sys from search with find command ?

I wanted to execute a script that picks out a random directory path: find / -type d | shuf -n1 Unfortunately I get error messages about the prohibition of entering certain directories. How can I ...
4
votes
1answer
76 views

How to perform the watch command onto expression with pipes?

I learned today the wonderful shuf command: ls | shuf shows me a listing of the working direcotry, but thanks to shuf each time I execute this piped command expression with another order. So I ...
5
votes
1answer
337 views

How to copy a file several times into randomly choosen paths within the filesystem?

I have a filesystem and a special file foo. I would like the script to choose several times (5,10 or 100) random paths to folders within this filesystem and to copy the file foo into each of them. ...
1
vote
2answers
42 views

Can not evoke watch command with non-integer time option

I want to start the w command periodically, according to man watch the smallest possible time interval is 0.1. I tried: watch -n1 w (works) watch -n1.5 w (does not work) watch -n0.1 w ...
0
votes
0answers
37 views

How do I realize a Shell Script that keeps track of how long the keyboard has not been used ?

Is it possible to write a script that counts the time between two pressed keys, so that one could put a script into the crontab that checks if the keyboard had not been for longer than a certain time ...