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

learn more… | top users | synonyms (1)

0
votes
2answers
37 views

How to pick a random element from the output of a command?

if I have sth. like echo 1 2 3 4 5 6 or echo man woman child what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 6 or man woman child ? echo 1 2 3 4 5 6 | command 3
0
votes
2answers
22 views

how would I convert this interface block into a command

I tried this: ifconfig br0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0 network 192.168.0.0 gateway 192.168.0.1 up But it did not work I am trying to use all of these parameters: ...
0
votes
2answers
54 views

How do I find a range of numbers in the content of file and move files containing the range of numbers to another directory?

Okay so I have about 90 files, each with a body like 187942 78.9 I want to filter files that has the values between 70 to 90 on the second column and move them to another directory. I'm ...
0
votes
0answers
32 views

How to split a A4 Letter page pdf into 2 4x6 pdfs

I get pdfs in A4 Letter size in portrait orientation, they have 2 sections top and bottom each 4x6. Right side of pdf is blank. I need to spit them into 2 pdfs 4x6 or 2 pages of the same pdf.. Ive ...
13
votes
4answers
119k views

How do I exit or cancel a bad bash command?

I expect to get some flak for this, but I can't find the answer anywhere. It seems like it should be so obvious. Sometimes, when I type a bad command in a bash terminal, the cursor just jumps down to ...
9
votes
2answers
5k views

How can I use ms-dos style wildcards with ls and mv?

I have the misfortune of coming from a MS-DOS background - but at least it makes me appreciate how much more powerful Linux is. I've been working on getting my Linux-Fu up to par, but there are a ...
1
vote
1answer
28 views

Packages and the like for configuring new systems [closed]

I'm faced with the prospect of moving from a server which has been configured previously with loads and loads of the sorts of tools you forget about day-to-day as you do various tasks (I'm talking ...
22
votes
8answers
1k views

Clipboard for copying and pasting files in command line?

In Bash, suppose I visit a directory, and then another directory. I would like to copy a file from the first directory to the second directory, but without specifying the long pathnames of them. Is it ...
0
votes
1answer
53 views

Downloading an attachment from Inbox using the command-line

Please help me figure out the right program to use to solve the following: Everyday I have a report emailed as a PDF attachment to my inbox. The subject is the same, and it is from the same email ...
1
vote
2answers
59 views

how to move all files from a pipe into a directory ?

I performed a file-command on all elements in my Desktop directory: ~/Desktop > file * then I grepped all the lines who have the string "image" in the description: ~/Desktop > file * | grep ...
0
votes
1answer
65 views

Create a symbolic link in the current directory

I have got a question were I have to create a symbolic link named "new" to file /test/test1/test2. The current command I have is this: ln -s /test/test1/test2 /new I am not if there is a specific ...
0
votes
0answers
25 views

Uninstall package from command line in unbootable system

I messed up my Raspbian Jessie system by installing upstart, and now it gets hung up while booting. Now I'm trying to get back to a bootable system by uninstalling it. I used these directions to get ...
23
votes
2answers
3k views

Create a test file with lots of zero bytes

I know how to create an empty file: touch /var/tmp/nullbytes but how can I create a 1MB file that only contains nullbytes on the commandline with bash?
-1
votes
3answers
71 views

Shell scripting : want to login on some server, which are in same domain and execute command and exit

I have 10 unix servers, I want to log into them one by one, execute 4-5 lines of code, save the output and exit. For Example: 10 serves: Intially at xyz server Login in server 1 --> execute 4-5 ...
12
votes
5answers
951 views

How to list all files in a directory with absolute paths

I need a file (preferably a .list file) which contains the absolute path of every file in a directory. Example dir1: file1.txt file2.txt file3.txt listOfFiles.list: ...
3
votes
2answers
160 views

Why the defined path is used as file name when I transfer files through scp to a Windows host?

When trying to copy a file from Linux (Raspbian to be precise, though I don't think it matters) to Windows using SCP: scp a.txt {user}@{ip}:\C\Users\{user}\a.txt The file is copied, but to ...
11
votes
1answer
4k views

Cleaning voice recordings from command line?

I have used Audacity for removing noise from recordings before, however it has very limited command line usage. I have ~100 short lecture videos which I will be watching over the next few months and ...
4
votes
5answers
1k views

How can I do the `history` command and not have line numbers so I can copy multiple line commands?

Sometimes I do the history command so I can see 4 commands in a row. I want to copy those commands so I can run them again. I usually select them with the mouse and shift-ctrl-c which works ok, but ...
2
votes
3answers
92 views

Using /dev/random, /dev/urandom to generate random data

I'm looking for ways to use /dev/random (or /dev/urandom) from the command line. In particular, I'd like to know how to use such a stream as stdin to write streams of random numbers to stdout (one ...
4
votes
1answer
36 views

I am stuck connecting to the internet via a usb wifi stick

I am trying to set up a an internet connection through a usb wifi sticker in Linux. Here's the sequence I tried: iw dev This returns the name(?) of the Interface that I want to connect to: phy#0 ...
0
votes
0answers
29 views

SSH Automation - Dynamically execute Script over SSH [duplicate]

Is there any tools do dynamically control with a local script a ssh session. So I can control the key pressed, wait some time, control the output. Something like AutoIt for Windows in the Linux/SSH ...
0
votes
1answer
31 views

command line in su - and background

I am writing a simple unix script to automate reading of a log file. The following does not give any output to the terminal. It just asks for the password for buser and then it just hangs. I ...
0
votes
2answers
69 views

How to use cd command in su command?

In the below script the cases aserver and bserver work fine. But in case "cserver" above, after su - gsxuserp, I need to perform the following three options with the same user. cd .. cd ...
0
votes
2answers
108 views

rmdir dir gives error 'Not a directory'

I have what looks to be a directory directory dir2, I once moved it from another directory dir1 to back it up and created a new dir1. Now I suddenly saw it again, realized I didn't need it and did rm ...
1
vote
5answers
16k views

check running process

I am new babe to Linux. So please skip to read if you are not patient with beginner. Let's say I am asked to check and shut down the processes that I am not familiar with. So when I ls under bin ...
0
votes
0answers
35 views

Get uptime for multiple VM's

Is it possible to get the uptime for other VM's that are on the same cluster without the need to ssh?
30
votes
3answers
4k views

Why is the password I entered not visible?

Below is an image of the process I took to create a user on bash in Linux. I understand that the password shouldn't be displayed for security purposes, but what I mean is, why do asterisks (or the ...
0
votes
2answers
68 views

Using Both Grep and Cut

I want to grep the output of tcpdump and cut some part of it but the command below is not working. tcpdump ... | grep -i --line-buffered "..." | cut -d'&' -f1,2 Do you know what is the problem? ...
2
votes
2answers
989 views

configure gsm connection using nmcli

I have a system without X display and I want to use nmcli to configure my cell modem to connect to a certain apn. I can get it going with this modem just fine on Ubuntu (with X) and I would like to ...
1
vote
1answer
34 views

Process list as a background process

abhigenie92@ubuntu:~$ (sleep 2; echo $BASH_SUBSHELL ;sleep 2) 1 abhigenie92@ubuntu:~$ (sleep 2; echo $BASH_SUBSHELL ;sleep 2)& [1] 3297 abhigenie92@ubuntu:~$ 1 [1]+ Done ( ...
2
votes
2answers
91 views

Avoiding plain-text password in http_proxy

I am behind a corporate firewall, which brings lots of pains in the area of proxies. There are two main approaches I've found to work: Use Cntlm at the cost of not being able to connect (from the ...
13
votes
4answers
705 views

Monitor hard disk activity

In a Ubuntu 14.04 server I am experiencing a massive hard disk activity which has no apparent justification: it comes as a burst, it lasts a few minutes and then disappears. It consumes system ...
2
votes
1answer
36 views

Use multi-threaded make by default?

Is there any way to have make use multi-threading (6 threads is ideal on my system) system-wide, instead of by just adding -j6 to the command line? So, that if I run make, it acts the same as if I ...
-4
votes
1answer
834 views

Does curl -Ls 'http://example.com' mean it will not output anything?

Does the s in -Ls mean that nothing should be outputted? If so what will be the output then?
26
votes
7answers
6k views

how to glob every hidden file except current and parent directory [duplicate]

I want to glob every hidden file and directory, but not the current (.) and parent directory (..). I am using bash. Observe current behaviour: $ ls -a . .. ...a ...aa ..a ..aa .a .aa .aaa ...
3
votes
2answers
3k views

su vs su - (on Debian): why is PATH the same?

I know what should be the difference between su and su -, but in my system (Debian) for example PATH is the same: [root]# su [root]# echo $PATH ...
0
votes
1answer
28 views

copy a directory into multiple directories

I have structure like A directory dir_a/dir_b and dir_c/dir_d to dir_z or some other 100 names. now I need to copy dir_b into dir_d and all other sub-directories in dir_c. And a part from that ...
-1
votes
1answer
39 views

Accidentally moved file to `,` (comma)

I logged in as a root user and when moving a file, instead of: mv myfile . I entered mv myfile , And now my file is gone but I am not sure where to. Where has it moved to?
17
votes
3answers
20k 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 ...
1
vote
1answer
64 views

Rename multiple files in multiple directories to the name of the directory plus 1

I have been attempting to rename a bunch of files to their directories. I have multiple directories with spaces and no spaces /The Dark Tower. In it are multiple titles with file names with spaces ...
21
votes
5answers
7k views

Why is echo a shell built in command?

$ which echo echo: shell built-in command. $ which ls /bin/ls $ which cat /bin/cat Why is echo not an independent utility like ls, ps, cat etc? Why is it shell specific? Any good reasons?
3
votes
6answers
742 views

Unix/Linux command syntax

This might come across a completely noob question, but on the other hand this has puzzled me more than a few times or probably I haven't seen enough of linux to draw a pattern. When linux commands ...
100
votes
3answers
96k views

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming ...
0
votes
1answer
6k views

Change hostname on SUSE Linux Enterprise Server 11 SP3 for VMware

I want to update the hostname for one of my VMware virtual machines running SUSE Linux Enterprise Server 11 SP3 for VMware . I tried changing the hostname using YaST but after reboot the old name ...
-4
votes
1answer
61 views

What does “|” between arguments in cat command do?

I understand what the "cat" command does. I.e. cat file1 file2 > file3 Will put the contents of file1 and file2 in file3. (If I am not mistaken) But what exactly does: cat file1 | file2 > ...
3
votes
2answers
40 views

Is it possible to display directory contents automatically while typing command?

I'm new to Linux. I wonder if it is possible to make terminal display directory contents automatically while I typing a command with directory arguments? For example, if I want to do cp ./fileA ...
3
votes
3answers
158 views

cannot move file because of & in name

Trying to command mv foo&foo.jpg images/ but get command not found, then if try and rename the file it won't let me.
1
vote
1answer
25 views

Stop ImageMagick from rotating image on append

I took two photos with my phone, one horizontal and one vertical, and they show up fine in Eye of Gnome. When I try to glue them top-to-bottom with ImageMagick's convert: $ convert img1.jpg img2.jpg ...
7
votes
4answers
832 views

pager program like less, able to repeat top N lines

Is there any way to make less program repeat first line (or first 2 lines) on every displayed page? Is there any other pager program which can do this? This would be a killer-app for database table ...
48
votes
4answers
47k 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?