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

learn more… | top users | synonyms (1)

0
votes
0answers
24 views

steps to troubleshoot bluetooth dongle?

How do I troubleshoot, or at least gather more data in order to troubleshoot, a bluetooth dongle? In particular, from the CLI. On a lower level, I can see the bluetooth hardware: thufir@mordor:~$ ...
0
votes
1answer
38 views

Cleanest way to require the user to enter password to run a program?

What is the cleanest way to require the user to enter password in order to run a particular program without the use of third-party applications? For example, if I type firefox to launch it from the ...
5
votes
1answer
96 views

Random image generator

I am generating random data and trying to convert it to a PNG image using : head -c 1MB < /dev/urandom | hexdump -e '16/1 "_x%02X"' | sed 's/_/\\/g; s/\\x //g; s/.*/ "&"/' | tr -d "\"" | ...
32
votes
2answers
1k views

Difference between “command not found” and “no such file or directory”?

For example: $ node -bash: /usr/local/bin/node: No such file or directory $ foo -bash: foo: command not found What's the difference? In both cases, node and foo are invalid commands, but it seems ...
0
votes
0answers
9 views

Why doesn't wpa_supplicant work when using crontab job?

I am writing a script that is installed via a crontab job. The point of the script is to locate a specific AP and connect to it on start up. The script will log its progress to a text file called, "...
1
vote
1answer
26 views

How do I select which remote vifm instance will run a command?

I run two separate instances of vifm on my machine: $ vifm --server-list documents photos In one I'm organising documents and in the other photos. Sometimes I'm inside a third shell and would like ...
0
votes
2answers
89 views

how to exclude string that include space by “grep -v” [closed]

I have a script that runs by using bash -c and I want to know how many process are running with that script. $ ps ax | grep my_script_run | grep -v grep | grep -v "bash -c" 11121 ? S 0:00 ...
-1
votes
3answers
47 views

Run su -s with arguments

I run to run a command using the su -s command to start a process. Since I do not want the root user to own the process. I try to do this by issuing the command su -s "$CATALINA_HOME/bin/catalina.sh ...
-2
votes
2answers
66 views

Find all line in a file which start with g or any digit from 0to9

How do I find all lines in a file which start with g or any digit from 0 to 9? Can any one help me using command line? I try and I know how to do if start with g but don't know how to do with g and 0 ...
1
vote
0answers
40 views

Converting .odm to .odt or .pdf - command line

I saw this question: Converting .odm to .odt, where someone shows to convert an .odm file into .odt or .pdf. Is there also a way to do this in a command line? I have an Open Document Master file, ...
0
votes
1answer
47 views

what is difference between l and ls commands [duplicate]

ls command shows the following : a code controller.js mani sparat this ubuntu.gif l command the shows similar to that : a/ code/ controller.js mani/ sparat/ this/ ubuntu.gif What is ...
2
votes
1answer
42 views

GNU screen tab gets renamed whenever I type a command

When I use gnu screen, in other tabs, I ssh into other machines, rename the tab accordingly, and do work normally. The tab name sticks. In a fresh tab, which is just a terminal on the original ...
1
vote
0answers
28 views

Find recursively files that have a percentage of lines in common

Is possible to do this? I want an output where i have only files that are 50% the same of others or have 20+ lines in commons. I'm trying to isolate commons functions in *.java files. Thank you!
0
votes
2answers
43 views

Is there a way to use this command without having to type 'y' all the time?

I am trying to remove all ruby gems before uninstalling ruby. The command I am using is: sudo gem uninstall --all to achieve this. However, I have to type y continually to remove things. Is ...
2
votes
3answers
55 views

How to delete a variable string in file

Actually I am using sed -e s/Perro-A//g -i *-a.log to delete the string Perro-A from many files ending with *-a.log. But sometimes in the files I might not have Perro-A; I might have strings ...
1
vote
3answers
179 views

Use regex to check if particular directory has folders starting with specific word

I am writing a script that checks a certain directory for any sub-directories starting with a specific word. Here is my script thus far: #!/bin/bash function checkDirectory() { themeDirectory="/...
0
votes
1answer
36 views

Pass filename from find and execute command

I'm trying to write a script which finds certain files and executes a command with the files it finds. Doesn't sound too hard, but I'm having a lot of trouble getting it to work. Basically this is ...
3
votes
1answer
59 views

Removing file and its sym links

If I create a file and symlink to it e.g touch "example" ln -s "example" "link_example" and use rm example the symlink is still there. How can I delete file and all symlinks that points to that ...
4
votes
3answers
46 views

Confirm “svn ci” command depending on my current location

I am working in a big project using SVN and many times I have to go see things in other people's branches and play with them. But I want to keep those changes local, never commit them. By mistake, ...
3
votes
2answers
29 views

Start command and provide prompt parameter

I have a command that builds things and then provides an interactive shell through prompt (eg type R to restart, Q to quit, ...). I would like to use that command but stop it once it reaches the ...
3
votes
1answer
39 views

How to receive input from 2 files on an executable

Basically, I want to receive input from 2 different files whem I'm calling an executable on terminal Like: ./a.out < file1.pgm file2.pgm I want to read both the files input on my code, one ...
4
votes
2answers
40 views

How would I get my terminal to regurgitate the previous output text from past commands? Is this even possible?

I just ran a job that takes several hours, and I forgot to pipe that text into a text file. pseudocode: echo [previous text output] > OutputHistory.txt Additionally, I can't just "copy and ...
1
vote
1answer
52 views

How would I make this script more efficient? [closed]

I am writing a script that will systematically install Numix theme using gnome-tweak-tool. I want to make sure that I don't reinstall items if they are already installed, so I used which [name of ...
2
votes
2answers
43 views

Can't create a file through symbolic link

I have a directory that goes like this: drwxrwxrwx 6 www-data www-data 4096 Jun 8 10:21 ./ drwxr-xr-x 31 user1 user1 4096 Jun 8 10:40 ../ lrwxrwxrwx 1 www-data www-data ...
0
votes
3answers
39 views

How to run a program in background and also using && to execute another command [closed]

I want to run my node app in background and curl simultaneously using && .I tried following but not work node app.js &;curl localhost and i tried another one node app.js & &&...
1
vote
1answer
46 views

How to pdfjam by Filename Numbering?

My files masi1.jpg masi2.jpg masi3-1.jpg masi4.jpg ... masi10.jpg masi11.jpg ... Command pdfjam *.jpg. Output: random. Expected output: as the list. There is no parameters in man pdfjam, only ...
0
votes
0answers
59 views

How to connect to WI-FI via WPS using wpa_cli?

How to connect to WI-FI via WPS through wpa_cli with PIN method and push-button configuration?
-1
votes
2answers
92 views

How do I grab image dimensions using ImageMagick cli?

I am having issues with the part of the following script where it takes the inputted image and checks its dimensions. If it's not a certain dimension then it resizes the image. My issue is what would ...
0
votes
2answers
39 views

What's the proper way to use a variable with spaces in part of a shell script command? [duplicate]

How can I include spaces as part of a variable used in an svn command for RHEL bash scripting? Or if there's something else wrong with the following, please advise. The SVN URL variable has no spaces,...
2
votes
0answers
61 views

how to capture the latest kernel version from grub.conf

how to capture the latest kernel version from grub.conf ( in case default=0) for example the latest kernel from the file is 2.6.18-409.el5 # all kernel and initrd paths are relative to /...
2
votes
0answers
24 views

Issue with adding a function to the .profile [closed]

I added the following to the ~/.profile: #Change desktop background f(x) function changeBackground() { FILE="'file://$(readlink -f "$1")'" echo changing to "$FILE" gsettings set org.gnome....
2
votes
1answer
170 views

How to filter lines passed through a pipe?

I've got a command foo that outputs a list of filenames: $ foo file1.a file2.b file3.a And a command bar that accepts the names of .a files as arguments and does some processing: $ bar file1.a ...
1
vote
4answers
67 views

How do I delete file by filename that are set as dates?

I want to delete file not by date access or created, but by filename. The filenames will be dates and I want to have a cronjob run once a week that will purge filename dates older than 7 days. I could ...
1
vote
2answers
63 views

How do I change FROM address using mailx on FreeBSD from command line?

I'm using following system: $ uname -a FreeBSD X 9.2-RELEASE-p17 FreeBSD 9.2-RELEASE-p17 #0 r282430: Mon May 4 13:59:58 PDT 2015 root@X:/usr/obj/usr/src/sys/R610 amd64 $ pkg info mailx mailx-0....
2
votes
3answers
132 views

Extract a line if the first field contains a dot

The actual data is: Dolibarr techpubl http://techpublications.org/erp tekstilworks.com WordPress tekstilw wbq.dandydesigns.co WordPress ...
1
vote
2answers
63 views

Convert command output to csv, with time stamp

I want to test a speed connection with terminal command: ./speedtest-cli And it returns This: Retrieving speedtest.net configuration... Retrieving speedtest.net server list... Testing from Moscow,...
3
votes
0answers
48 views

Dbus: Logout other user

I'm new with dbus. I know how to logout current user from terminal using dbus messages dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager ...
1
vote
1answer
45 views

Will these commands return the same output on different Linux distributions? [closed]

I am writing a monitoring script. I am running it on a specific machine, and it works. It is planned to be ran on several Linux machines, not bound to a single distribution. Here are the commands and ...
2
votes
1answer
16 views

Why xdotool is not clicking when restoring position?

Why xdotool is not clicking when restoring position? xdotool mousemove --sync 4000 1000 click 1 mousemove restore If I don't restore the position, it works, example: xdotool ...
1
vote
1answer
42 views

How to re-format a matrix

I have a file like this: column1 column2 column3 column4 column5 5e-05 1e-05 0.00083 4e-05 0.00021 6e-05 3e-05 1.00083 2e-05 1.00021 And I need to re-format it to print and output ...
0
votes
0answers
29 views

Get rid of ksshaskpass in KDE Plasma (Fedora 23)

I'm using Fedora 23 with KDE 5 Plasma. I'm new with KDE, and I'm still setting up the environment so it can fit me. I recently used a git command, which asked for my github credentials - but instead ...
2
votes
2answers
47 views

Print text between two strings - omit second occurrence

I have an instruction file with a lot of steps. I'd want to view a single desired step in a shell, without graphical environment. What I do right now, as pointed out by alemol, is using sed to extract ...
2
votes
1answer
34 views

MySQL command line - bind <UP> key to a backward command search

With mysql command line client on Ubuntu 14.04 I could bind UP to a backward command search by adding the following lines to ~/.inputrc # type a word, hit up and a search is performed # "\e[A": ...
0
votes
1answer
48 views

Explain the output of realpath [closed]

I am trying to use the command line to return the absolute path to a file. I read that there are multiple ways to go about this, namely the realpath, readpath -f, and locate commands. None of these ...
1
vote
0answers
34 views

How to read the password of a user and implement it in the subsequent commands?

I am writing an api call that requires the user id and password of the user. I can get the user id but how to get his password and supply it to a variable? Here is the api command curl -u $user:$...
3
votes
4answers
114 views

All possible permutations of words in different files in pairs

I have multiple files, let's say file1, file2 etc. Each file has one word in each line, like: file1 file2 file3 one four six two five three What I want is to combine them in a new file4 in ...
0
votes
1answer
58 views

how to read all bios settings in linux programmatically

I don't think that dmidecode shows all the bios settings . Is there a way to read all the bios settings programatically in SLES?
2
votes
1answer
62 views

bash case-insensitive commands matching

Is it possible for bash to find commands in a case-insensitive way? eg. these command lines will always run python: python Python PYTHON pyThoN
1
vote
1answer
43 views

Move files several directories up for several directories with similar layout

I have a directory with the following layout (the layout in Directory 1 is repeated in every other Directory <num>): Parent directory Directory 1 some directory another ...
2
votes
4answers
53 views

Access a file located with find

In many cases after I find a file using the find command I then want to open the file or cat it or maybe print it. How can I operate on the result from find? For example, : find . -name "myfile.txt" ...