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

learn more… | top users | synonyms (1)

4
votes
2answers
78 views

Why does path-completion in bash not always work?

With different bash-environments (different installations) I have different behaviors in terms of path-completion when hitting TAB on the command line after . Where is this handled? One specific ...
3
votes
1answer
107 views

Is there a way to use regex expressions to auto-fill filenames in bash?

Assuming I have a directory with files as shown: $ ls file0001.txt file0002.txt file0003.txt file0004.txt file0005.txt someotherfile.txt Lets say I want to run the following command: $ cat ...
0
votes
2answers
45 views

return first instance of characters from a list

Lets say I have the output of this command saved to a file. cat /dev/urandom | tr -dc '[:graph:]' | fold -w 1000 | perl -pe 's/(.)(?=.*?\1)//g' | head -n 50 I would like to compare only the first n ...
5
votes
1answer
176 views

Performing atomic write operations in a file in bash

After going through the bash documentation, this question and this one it's still not clear to me how can I perform atomic write (append) operations to a file in bash. I have a script that is run in ...
0
votes
1answer
47 views

mv misbehaves in shell script [closed]

I have the following folder structure: /backup /backup/copy.sh /backup/archive/ /backup/20160405_logs/ /backup/20160405_logs/sql.log /backup/20160405_logs/bak.log I want to move the folder ...
1
vote
1answer
62 views

Get windows' titles using command line

Is it possible to get the titles of all the running GUI application windows via CLI? The titles which are also shown on the task bar buttons. For example: Firefox: cPanel X - Main Nautilus: File ...
0
votes
1answer
48 views

Column comparison using awk [duplicate]

I would like to compare the first column of file1 with the second column of file2 and only if they match it should display any matching lines in file2 only as the output. The columns are separated by |...
0
votes
0answers
30 views

Syncing two folders between two Linux workstations (Two different networks)

I have two Linux work stations: Workstation A at home Workstation B at work The workstations are linked to the internet and they don't belong to the same network. How can I sync a folder "Test" ...
0
votes
0answers
21 views

du -sh * discrepencies [duplicate]

Can someone explain why the following results do not add up. I just rebooted and logged in, and I have the following: As root: du -sh /home/* 7.8G /home/mike 4.0K /home/Systemback `du -sh /home/...
0
votes
1answer
36 views

Is there a command-line application that combines SSH and SFTP? [duplicate]

When I'm working on some remote host via SSH, I often need to upload or download files. With my current setup, I need to switch to another terminal and conjure up rsync or sftp, which can be a pain ...
0
votes
2answers
46 views

Extracting a certain folder from a tarball - how do I tell it where to put the file once extracted?

I've looked around at multiple sources for this question and I know how to extract the file, but neither source told me how to state where to put the folder once it has been extracted. I tried this: ...
0
votes
0answers
75 views

How do I extract subtitles from Video files?

I want to use the command line to extract subtitles from video files. I want to extract subtitles from a lot of files. That is why I want a CLI tool. Ideally it should work with any video format ...
1
vote
1answer
82 views

Why does terminal say it's installing a package that's already installed, when I try to install something completely different?

I'm on Fedora 23 MATE. I tried to install virtual box an hour ago but it wouldn't because their website is down. I had also installed gyazo. That had no issues. Now when I try to install ...
0
votes
1answer
34 views

Excluding files whilst using tar to zip site contents not working [closed]

I'm trying to zip the contents of a site using tar and exclude a bunch of folders and error_log files but it doesn't seem to be working, when it's processing I still see many of the excluded files ...
-1
votes
1answer
52 views

Tried to install Nvidia drivers, now I can only boot to tty [duplicate]

I'm on Fedora 23. I followed this guide and got all the way up to the "2.7 Reboot to runlevel 3" step. I did that step then rebooted and now I can only boot into tty. I tried to continue on with ...
3
votes
3answers
152 views

Add mtime to grep -c output and sort the output by mtime

I have a directory full of logs named in the following style: info.log00001 info.log00002 info.log00003 ... info.log09999 info.log My current output (using grep -c) I need to analyze the ...
0
votes
1answer
46 views

Copy process output few lines to a file

I want to copy the xinput-calibrator output to the temp.txt file from my Qt application. I am starting the QProcess from the Application Using the command xinput_calibrator | tee log.txt, I am ...
7
votes
4answers
851 views

Is it possible to name a part of a command to reuse it in the same command later on?

If I want to move a file called longfile from /longpath/ to /longpath/morepath/ can I do something like mv (/longpath)/(longfile) $1/morepath/$2 i.e. can I let the bash know that it should remember ...
-9
votes
2answers
293 views

What does the cd /etc command do?

I was asked the question "what does the cd /etc command do?". This is my answer: This command cd /etc changes directory to the directory specified after the slash /. The /etc refers to a folder in ...
3
votes
2answers
70 views

rlwrap: tclsh multi-word autocompletion

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
3
votes
1answer
46 views

Problem with encoding in shell script

I have the following code: #!/bin/bash task=$1 xml=$(curl -sL "http://login:pass@server.com/issues/$task.xml") id=$(xmllint --xpath '//issue/id/text()' --format - <<<"$xml") name=$(xmllint --...
2
votes
2answers
59 views

cd out of deleted folder

Is there a way to cd out of a directory which has just been deleted (go up one level into the upper folder which still exists? It often happens to me that I have a console opened for a folder, and ...
0
votes
0answers
59 views

how to run android dex from command line in ubuntu 14.04

I write a program which has ant build file with this command: <exec executable="dx" dir="${workdir}"> <arg value="-JXmx${env.JavaHeap}"/> <arg value="--dex"/> <arg ...
2
votes
1answer
31 views

Insert string or line after last instance of a specific search variable, in a loop

I'm wondering if someone could help me with a specific coding question. I have a DNA sequencing file that reads something like this (as an example): ...
-9
votes
1answer
53 views

Unix “ls” command? [closed]

Can someone explain to me what are all the options available with the -la flags for the ls command ? I have read the man pages, but still not sure.
1
vote
0answers
130 views

Find list items in other file [duplicate]

I have one file with hundreds of unique IP addresses (each on a separate line) from which a bot tries to login to one of our services. I would like to see which of these addresses appear in another ...
0
votes
1answer
77 views

Shell script - creating and assign to groups advice needed on my script

Where could I include man useradd and -g and G i'm not sure where to include these commands above. The current shell script doesn't successly create the user but does run. #!/usr/bin/env bash ...
-1
votes
4answers
36 views

How can I address the path/file I just specified again? [duplicate]

Say I'll start writing sudo cp /etc/var/more/evenMORE/fileABC and as the target of the copying, I'd like to define the same folder, except just a different filename (whether it is a new name like "...
4
votes
4answers
537 views

Run the same command multiple times in background

How is it possible to run multiple commands and background them using bash? For example: $ for i in {1..10}; do wait file$i &; done where wait is a custom binary. Right now I get an error: ...
1
vote
0answers
32 views

Is there a common way to render out pdf files in a human-readable format on the command-line and keep the general layout?

I'm imagining something deeper than pdftotext (part of poppler-utils), because what I was imaging would be possible, would be to retain most of the layout on a virtual page, e.g. pipe this through a ...
1
vote
1answer
62 views

How can I access the history buffer in sh? (not in Bash)

Is there a command history in sh, for example how to access it, and as well, how to ensure it is clear? To clarify shells here: let's say you've logged on to a non-Gui Linux system, and $SHELL is ...
1
vote
1answer
53 views

Is bash command line interpreter implemented on emacs?

I'm investigating the relationship between bash and emacs shorcuts. Someone told me that the reason why they're similar is that bash uses emacs as its command line interpreter. However, I haven't ...
1
vote
2answers
45 views

Search for processes which are CPU consumming

I can track the process launched by the user4 with awk: ps aux | awk '$1~/user4/' And also to track what process consume more than 10% CPU: ps aux | awk '$3> 10' Hoe the question is not too ...
0
votes
5answers
101 views

Remove the latest modified file

I have created two files: sample.txt and sample.txt  (the second file contains some hidden characters, e.g. a space). How can I remove the latest modified file? I'm using Linux.
0
votes
1answer
45 views

How to force an application to use a specific cpu? [duplicate]

For example : To build a kernel we can use make it will take more than one hour , to accelerate the process we can use make -j4 all this may finish almost four times as quickly. Generally : How to ...
0
votes
2answers
112 views

why is btmp not showing the username of logged in users?

I am trying to compare the output of the btmp file and who -a commands. I don't know why, but btmp file currently is not showing the username but its showing UNKNOWN in the username field. I am (...
5
votes
3answers
697 views

Remove file, but only if it's a symlink

Ideally I'd like a command like this rm --only-if-symlink link-to-file because I have burned myself too many times accidentally deleting the file instead of the symlink pointing to the file. This ...
1
vote
1answer
41 views

“time > time.txt” refuses to work propely

I just started learning Linux commands. I was experimenting with the > command, that, as far as I understand, makes the command before it write it's output to the file after the sign. This ...
4
votes
2answers
101 views

Modify Openbox key-bindings from commandline

I am using the LXDE desktop environment, which is based on Openbox. I know how to change the key-bindings by editing my ~/.config/openbox/lxde-rc.xml, e.g.: <keybind key="A-F11"> <action ...
1
vote
1answer
33 views

Is there a program that will launch a configurable context menu

I'm looking for something like Zenity or Yad, except I want something that behaves like a menu, namely: it opens right next to the cursor; it takes one click to select things; it's possible to have ...
3
votes
2answers
52 views

On applying commands to groups of lines from stdin

The Unix package datamash supports the application of several summarizing operations to groups of input lines. For example1, here datamash is used to compute the sums of column 2 for each value in ...
2
votes
0answers
799 views

m: command not found

just tried to compile the R-language from sources but my make aborted with m -f liblzma.a make[4]: m: Command not found I eagerly searched the web but it seams it's impossible to find the command ...
0
votes
1answer
52 views

Unable to detach a USB device on Ubuntu 14.04

I was using udisks to unmount and detach usb device with following commands which works just fine on Ubuntu 10.04 udisks --unmount /dev/sdb1 udisks --detach /dev/sdb Because udisks is not available ...
0
votes
0answers
22 views

How to recover content of the file in unix? [duplicate]

I accidentally gave cat >filename instead of cat filename and my content is lost.Now I have only my file,but content is deleted.How to recover the content alone? Please help me to get back the content....
0
votes
1answer
52 views

Unix, create file based on command [duplicate]

I have a command, but I want to get the results into a .txt file I can open. How do I alter my command to allow the results to be put into a text file. I plan to transfer this .txt file to my local ...
1
vote
0answers
27 views

How to connect to wifi using nmcli with a static IP address and password?

There is info on how to connect to ethernet(eth0) with nmcli using a static IP, but nothing on how to connect to wifi (wlan0)? This sets up a connection profile but how to add the password and ...
3
votes
1answer
45 views

Argument list too long when running ls -d “$PWD”/* command

I'm trying to execute ls -d "$PWD"/* > formmlFileList43k.list But I get the following error: bash: /bin/ls: Argument list too long I've read using a pipe won't have such limitation, how can I ...
1
vote
2answers
66 views

Retrieve name of the active network interface only [duplicate]

How can I retrieve from the command line (or a shell script) only the name of the active network interface, in Linux? If there are several active interfaces, I want just one (selected arbitrarily).
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
74 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 ...