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

learn more… | top users | synonyms (1)

4
votes
4answers
113 views

Difficulty converting from binary to hexadecimal using bc

I read how to calculate using the command line calculator and a HERE-document, but nevertheless I do not get what I expected and can not find my error, what I did in the shell was: bc << HERE ...
0
votes
0answers
39 views

Touch a file and give it an icon image via command line

Imagine this situation: for a given task, at some point of it, I should be able to create an empty file, which I can achieve by touch file.ext on the command line. However, if I touch a .jpg file, and ...
0
votes
1answer
47 views

Search a file for a string in multiple directories

Can someone please help me with a command to search a file for a string in multiple directories? I am searching for the VIP in httpd.conf in multiple httpd instances. I am using: find ./ -name ...
1
vote
1answer
38 views

Only pipe on Success [duplicate]

Is there a way in the Linux command line, to only have a command pipe its output to another, when the command didn't fail? $ cmda | cmdb I would like it, so when cmda returns a status code other ...
0
votes
1answer
14 views

Makes it a difference whether I use a different -n flag value for xargs in combination with find command ?

Assume, someone searches for files that match some criteria using the find command and pipes the result into the rm command. find / -type f -name "*.jpg" | xargs rm First, I am not sure if the ...
1
vote
3answers
106 views

What is the reason for having numbers within the brackets of a function ? [duplicate]

I have seen on many occasions a name of a function (frankly speaking I just call it function because of it typical appearance, they are though sometimes named commands or system calls but I do not ...
3
votes
1answer
35 views

why does the output of xargs -n2 applied to the same number of arguments different whether piped or from keyboard?

when I execute xargs -n2, enter x x x x x and hit Enter, I get only 4 x back: $ xargs -n2 x x x x x x x x x But, when I pipe the x x x x x into the same command, I get the same amount of x back: ...
1
vote
1answer
68 views

cat .bash_history | grep ./configure [closed]

Why does this not give any output: cat .bash_history | grep ./configure on an system/in an shell where ./configure has been run multiple times. And if I use the arrow key's to scroll the history in ...
1
vote
1answer
63 views

Can not set the LC_TIME variable for the current process [duplicate]

On Linux Mint Rebecca, my current LC_TIME setting is LC_TIME="en_US.UTF-8" I would like to execute date and watch how the current date is displayed in a Chinese format with Chinese characters. ...
3
votes
2answers
77 views

How to list files on terminal so that we can see the file types such executable, ascii etc?

I have been trying to list files in directory using ls and passing it different options. Does it have the ability to list types of files as well ? I want to know which ones are executable , ...
0
votes
1answer
44 views

What is the logic behind the expression cat > foo << “wordofchoice” [duplicate]

I know the > and >> operators, > puts something into a file by deleting the old content, >> appends something onto the end of the file's content. When I only use cat > foo I am able to write ...
1
vote
1answer
37 views

How to configure the system in order beeing able to hear the sound of the \a escape character?

I read, that if I execute: echo -e "\a" a sound emerges, but frankly speaking, i executed this command several times and no sound happened.
5
votes
3answers
299 views

How to put a newline special character into a file using the echo command and redirection operator?

I would like to create a file by using the echo command and the redirection operator, the file should be made of a few lines. I tried to include a newline by "\n" inside the string: echo "first ...
0
votes
0answers
36 views

Dropped connections with b43 driver using Broadcom BCM43228 wireless chip on Arch Linux

I managed to get my wireless working with the b43-firmware package in the AUR and for at least a month it worked perfectly. However, recently the internet connection has been dropping out. I'm ...
1
vote
2answers
41 views

Open Firefox twice (with same profile)

There are tons of resources that tell how to run several instances of Firefox in parrallel. I can't find any that tells me how to configure a command (on a command line, start menu item, or panel ...
0
votes
1answer
23 views

. as a command line argument to a command running in background

I run grep some-string -r . &. While it is running in bkg, I cd to another directory. It seems that grep interprets the hard link . differently then. What happens before and after I change the ...
1
vote
1answer
76 views

How to Prompt the user to press Enter to Exit in terminal so that the terminal doesn't close automatically?

Here is my Port.sh file echo 'Give me a maximum of 5 seconds to run please.' lsof -i | grep Xvnc | grep ESTABLISHED | grep $USER lsof -i | grep $USER | grep Xvnc | grep -o -P '(?<=:).*(?=->)' ...
1
vote
1answer
23 views

How to determine the only additional file in otherwise two identical listings?

I have done a listing of the device folder two times, one time without the sd-card in the slot and one time inserted, the system automatically adds one file in the device folder. $ ls /dev | wc -l ...
3
votes
2answers
251 views

How to Find UID, GID, and any groups I belong to?

How to Find UID, GID, and any groups I belong to ?
5
votes
2answers
212 views

How to count duplicated last columns without removing them?

I have a file that contains 4 columns. I want to compare the last three columns and count how many times they occur without deleting any of the lines. I just want the count to be present in front of ...
1
vote
2answers
42 views

Live resizing of an ext3 filesytem on CentOS6.5

I have a problem with my remote server hosted by my provider, I have only SSH access. The problem consist of getting this error file system rootfs has reached critical status that causes problems with ...
1
vote
0answers
32 views

Printing to the terminal after boot

I am attempting to start a script that echos to the terminal once matchbox-terminal is loaded. I am able to run the script if I execute it in the existing xsession script located in ...
1
vote
1answer
65 views

awk with variables in condition and in output redirection file

I would please like some help with this command because I didn't find anything in documentation that can cover everything I want. I have some variables that are global, so I would prefer to keep them ...
2
votes
1answer
31 views

Is there a command that outputs ONLY the packages explicitly installed by the user? (ubuntu/debian)

I have tried searching for this but there seems to be no command that can output a list of packages (ideally in Ubuntu) that I have installed, not including any dependencies.
0
votes
1answer
32 views

unable to remove stopped job with ctrl+c

When I tried to change from super user to common user and therefore typed "exit", I got an error message, that a job was stopped and I could not log out as root. So I listed the jobs: #jobs [1]+ yes ...
11
votes
3answers
429 views

How can I make a graphical plot of a sequence of numbers from the standard input?

If have a long text file and I want to display all the lines in which a given pattern occurs, I do: grep -n form innsmouth.txt | cut -d : -f1 Now, I have a sequence of numbers (one number per line) ...
2
votes
2answers
235 views

Is it possible to login as root without the interactive password query ?

When I want to login as root, I usually have to type: su -l and than an interactive query starts in order to receive the password. Is it possible to login as root without this interactive query ? ...
0
votes
1answer
55 views

How can I observe my own actions via terminal

To understand Linux better I want to see which commands run in background. For example when I create new file via GUI, is there any way to see the which command runs in terminal?
0
votes
0answers
19 views

How to read - in Linux? [duplicate]

Whenever I am dictating linux CLI commands to someone I get in a dilemma on how to say - in English. For example, to dictate ls -la I sometimes say L S minus L A or L S hyphen L A or L S dash L A. Is ...
3
votes
2answers
140 views

How do you stop a bash shell expansion?

I know some methods for stopping process. When I type: echo {1..999999} > filename.txt I can't stop it from running. I can stop other processes with Ctrl+C | Ctrl+D | Ctrl+\ and etc. But none ...
1
vote
1answer
37 views

Why do my run level directories contain only start scripts and no single kill script?

I learned here that for each runlevel exist a directory with start and kill scripts. The start scripts are activated on entering , the kill scripts on leaving the runlevel. Start scripts and kill ...
2
votes
4answers
146 views

Creating directories in a loop and moving files to those directories

Consider a directory with N files. I can list the files alphabetically sorted and store the list by ls > list Then I want to create n sub-directories in same directory, which can be done by ...
3
votes
1answer
62 views

rlwrap -z pipeto: piping output through pagers

I am using rlwrap to colorize prompt in asterisk CLI: rlwrap -s 99999 -a -pRED /usr/sbin/asterisk -r I read in man rlwrap that I can also use rlwrap -z pipeto to pipe output through a ...
1
vote
0answers
20 views

How to start the twm manager on a system which already has a window manager ?

I am using linux mint codename rebecca with xface. I tried to follow a description how to start a window manager of once choice: created an empty .xinitrc file in my homefolder filled the file with ...
0
votes
0answers
20 views

How to install a particular version of boost with brew on MacOSX?

The command "brew install boost" works for me on my MacOSX, but it installs the latest boost 1.57. How to use brew to install the older 1.55?
2
votes
4answers
319 views

What is the difference between (cp f1.txt f2.txt) & (less f1.txt > f2.txt) [duplicate]

I know that both will copy data from f1.txt to f2.txt, but what is the real difference? (cp f1.txt f2.txt) vs: (less f1.txt > f2.txt)
0
votes
1answer
28 views

How can I expand a terminal using the command line? [duplicate]

When I start the terminal in my xfce Destop environment a black winodw about a quarter of the screen size appears, if I want to expand it to full screen size I have to click on the "+"-shaped symbol ...
1
vote
2answers
22 views

Transform values in a line by first field

I was wondering if there is an easy way to do the following without writing a script. Transform 1234,"a;b;d" 2345,"e;f;g;h" to 1234,a 1234,b 1234,d 2345,e 2345,f 2345,g 2345,h
1
vote
1answer
133 views

Operate X clipboard from command line

I'd like to copy and paste to the clipboard from the command line. I've found two utilities that works with "mouse" selection: xclip and xsel. But they both ignore the clipboard that is filled with ...
20
votes
4answers
864 views

Is it possible to redirect the output of a command into more than one command?

As far as I know, I can use the tee command to split the standard output onto the screen and further files: command -option1 -option2 argument | tee file1 file2 file3 Is it possible to redirect ...
2
votes
1answer
24 views

Sandbox an account and prevent it from any system modifications

I am trying to sandbox a user account to the point where it cannot edit or view any files beyond a certain folder, namely /home/user/test. This account will be compiling and running a C++ program that ...
9
votes
1answer
366 views

Why does the echo command do not work with at command?

when I type: at now + 1 min at>play /usr/share/sounds/startrek.wav at>ctrl+d it works, so after one minute there is actually a sound played. but, when I type: at now + 1 min at>echo ...
0
votes
1answer
156 views

extract number of bytes out of a file

Is it possible to extract a few number of bytes out of a file using dd ? The file is located on a secondary drive. I apologize if this is a simple question however I'm no pro at command line.
0
votes
1answer
226 views

Replacing white-space / characters with backslashes [duplicate]

I want to convert a bunch of mkvs to mp4s with the following command: for i in $(ls *mkv); do ffmpeg -i $i -vcodec copy -acodec copy $i.mp4; done; However, the filenames have whitespaces and ...
0
votes
3answers
37 views

Why do du's subdirectory values not sum up to total?

I'm trying to use du to investigate disk usage in a directory like so: du -hd1 | sort -rh This gives me a list that starts as follows 61G . 7.9G ./A 5.1G ./B 2.7G ./.C 1.6G ./.D ...
1
vote
0answers
24 views

Check if there is no GUI

Is it possible to check if a UNIX machine (Mac / Linux) has a GUI? Basically I would like to distinguish between: UNIXes with GUI (i.e. normal Macs, Linuxs) UNIXes with no GUI (i.e. Mac server/ ...
0
votes
1answer
22 views

How to switch from input mode into command mode in ed ?

As far as I know, ed starts in command mode. Once I input i,a or c ed changes into input mode. So far it worked. Now I read that in order to switch from input mode into command mode one has to input ...
2
votes
1answer
42 views

How can I redirect output files to a specific directory/folder

Suppose I have an executable in Unix. Suppose the name of the .exe file is myExe and it takes two parameters. I did not create this executable, this is a freely available one. myExe generates 4 ...
0
votes
4answers
66 views

How does “-dc” work in “cat /dev/urandom | tr -dc ”01"?

So far I know, the /dev/urandom file is one of the special files, it's purpose is to generate random characters. When I execute cat /dev/urandom a stream of strange characters, some even Chinese ...
0
votes
2answers
57 views

Why would the prompt get overwritten?

p_ash-3.2$ cp some_file1234.html /some/loc/ation/ofthe/some_file1234.html.html_Backu Have been seeing this intermittent issue with the command-line, while typing longer lines as part of any command, ...