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

learn more… | top users | synonyms (1)

1
vote
1answer
50 views

Updating a git variable in the Shell prompt on every command

I am running TCSH and I would like to update my prompt every time I run a command. I think can currently do that via backticks. set tmpstr = `git status --untracked-files=no --porcelain` set ...
5
votes
5answers
543 views

Run same command with different parameters

I've a not really permissive program to work with. Unfortunately, this program doesn't just allow the following "command -a -b -c" or "command -abc" So I've to always type the following command ...
0
votes
1answer
20 views

What the long option “ --debug” suppose to do in bash?

GNU bash, version 4.3.42(2)-release-(i686-pc-msys) Usage: bash [GNU long option] [option] ... bash [GNU long option] [option] script-file ... GNU long options: --debug ...
2
votes
1answer
40 views

How to quickly cd to a command's directory after used the 'which' or 'type' [duplicate]

I want to cd to the directory of go's bin file: $ type go go is /c/tools/go/bin/go How can I quickly cd to this directory in bash ?
0
votes
2answers
34 views

Is it possible to see errors when executing a script inside a script?

I have the files my1.sh and my2.sh. my1.sh: .... do something ./my2.sh my2.sh: .... do something else Now my problem is that if any command (like or example a ntfsclone) fails in my2.sh I get ...
0
votes
2answers
22 views

return value of command not displayed in script

If I execute the below rsync command in command-line , I am getting the proper return status /usr/bin/rsync -azv -p /home/zaman x11server:/home/zamanr &> rsyncjob/output."$datetime" echo $? ...
1
vote
1answer
45 views

shell command cd !$ [duplicate]

I looked at this question and googled, but can't find a definitive answer. What does !$ do when typed into terminal? I typed mkdir /path/to/dir cd !$ Which brought me to /path/to/dir but I still ...
1
vote
2answers
48 views

what condition we need to use “.” in command line? [duplicate]

a question - in some case, I saw command line like this . ./test.sh I'm curious why use "." before "./test.sh" what condition we have to use "." before a command?
0
votes
1answer
32 views

Create command line variables with PATH

As I am more of a web guy, i need a little help with this one, so I will explain what I am trying to do before I ask. I am creating batch script that will: GET request from an external server (json ...
0
votes
1answer
45 views

How to count the number of files in current directory that contain a specific phrase? [duplicate]

I want to count number of files in current directory that contain the phrase "HW". I tried ls -l | grep HW | wc -l
1
vote
1answer
45 views

How to make the prompt beep with every key press/character printed?

You know how hollywood movies depict hacking scenes with fast yet scrolling CLI technobabble in this fashion : https://www.youtube.com/watch?v=-jkj60TUWaE I want to know how to modify linux to make ...
0
votes
4answers
78 views

Flattening complex folder structures with duplicate file names

I have a folder with a complicated folder structure: ├── folder1 │ ├── 0001.jpg │ └── 0002.jpg ├── folder2 │ ├── 0001.jpg │ └── 0002.jpg ├── folder3 │ └── folder4 │ ├── 0001.jpg │ ...
3
votes
1answer
86 views

Set default shell as bash for users not in /etc/passwd

On my company's Ubuntu 15.10 desktop system, I log in via Active Directory using some magic based upon PBIS. Thus, my user account is not listed in /etc/passwd even though I have a home directory ...
0
votes
1answer
25 views

How can i list all stopped services in the order that they were stopped

I have a Debian server on which there are certain stopped services. I would like to know how can i list all the services in the order that they were stopped. Also would like to get the time when they ...
0
votes
0answers
52 views

Flattening folder structure with duplicate file names [closed]

I have a folder with a complicated folder structure: ├── folder1 │ ├── 0001.jpg │ └── 0002.jpg ├── folder2 │ ├── 0001.jpg │ └── 0002.jpg ├── folder3 │ └── folder4 │ ├── 0001.jpg │ ...
4
votes
2answers
67 views

How to modify files on Unix to avoid file purging policy?

We have a policy on our cluster that any files not modified or accessed within 30 days will be deleted. I have a project running and I want to keep all files until I finish it, would it be possible to ...
1
vote
1answer
32 views

Difference between “-” and “--” prefixed command line parameters? [duplicate]

Scripts on command line offer a wide range of parameters types. Often parameters can be passed to the script via "--[parameter]" or "-[parameter]". But what is the difference? Why do some parameters ...
0
votes
1answer
32 views

Debian: “update-command-not-found” IOError: Not a gzipped file

I run a random command in terminal and got this response: Could not find the database of available applications, run update-command-not-found as root to fix this Naturally, I run ...
0
votes
1answer
47 views

How to create a dynamic greeting?

Recently made the switch to Linux/command line, and I'm having trouble creating a dynamic greeting for terminal out of a list of predetermined possibilities. I tried the following, but it appears as ...
10
votes
4answers
813 views

Why doesn't echo called as /bin/sh -c echo foo output anything?

For example, while this works: $ echo foo foo This doesn't: $ /bin/sh -c echo foo Whereas this does: $ /bin/sh -c 'echo foo; echo bar' foo bar Is there an explanation?
0
votes
1answer
26 views

Pattern highlighting command [duplicate]

Folks, I want to know if there exists a command that just highlight some portions of the input text, rather than filtering it like grep does. To give an example, suppose the following input text: ...
1
vote
2answers
98 views

`open` command to open a file in an application

Why can't I run this command in my terminal: open index.html Wasn't it supposed open this file on my browser? Also can't I run this command: open index.html -a "Sublime Text". The result of these ...
0
votes
3answers
66 views

How to display size “human-readable” in lsof | grep /var* [duplicate]

I am currently trying to see , all the files which are using /var mount. With lsof | grep /var* when Its displaying size in bytes. How can I display file size in MB. Thank you.
0
votes
1answer
19 views

Find out user logged in at specific time on Mac OS X 10.11.x

I'll like to find out which user was logged in at a particular time that a file was created. I'm having trouble with the "Last" command when attempting to use the "-t" switch. Open to any ...
0
votes
0answers
12 views

Monitor shuts down when entering Terminal [Linux Mint]

I have a relatively small monitor for one of my machines that Linux Mint. When entering the terminal (ctrl + alt + F1) The monitor shuts down and I have to, completely blind, scrawl out my login and ...
1
vote
1answer
16 views

command to enhance console lines with history

cmd utils such as sqllite don't have full flavoured console support. but I do remember there is something called **wrap which could wrap this console and enhance its capabilities with history, up/down ...
3
votes
1answer
89 views

ss - linux socket statistics utility output format

When using ss with -p option, user/pid/fd column jumps underneath the particular line. For instance this is it what I'm actually seeing: # ss -nulp4 State Recv-Q Send-Q ...
1
vote
1answer
41 views

How do I change a LUKS password?

I would like to change a LUKS password. I want to remove my old password, but I would like to try out my new password before removing the original. I obviously know the old password. I would like to ...
1
vote
3answers
139 views

Number of occurrences in a text file where first character after 12th pipe is equal to 1?

I am fairly new to regular expressions and am looking for a sed/awk/grep/wc command to find the following in a pipe delimited text file the number of occurrences of the digit 1 after the 12th pipe. ...
1
vote
2answers
139 views

File manipulation; Insert a “;” every 12th, 44th and 60th character in every line of a text file

I have to make a csv-file from a textfile which contains data without any delimiters. Looks like: 2015021DUMMY001EAN1377689456777678945GERDE0002345 2015031DUMMY002EAN1345647876867867867TURTR0154565 ...
0
votes
1answer
23 views

control-w (delete word) deletes whole line in MariaDB client

I've been using the original MySQL client for "eons" and I'm rather accustomed to using bash-like shortcuts in it. One of my more frequently used ones is to use control-w to delete the word before the ...
5
votes
2answers
178 views

Command to remove the first N number of lines in input

Background I am running an SSH server and have this user that I want to delete. I cannot delete this user because he is currently running a few processes that I need to kill first. This is the ...
0
votes
0answers
22 views

How does GUI works different from the shell CLI?

For example if I want to remove a file I would write rm command in my shell CLI. But when I delete a file using GUI how does the process works ? For shell it would find the filesystem for rm program ...
1
vote
0answers
19 views

Search drive and copy source to flat target

I have backups and backups of backups (there are copies of copies) of images spread out over various drives. I want to scan the drives and copy all images from a source to one flat target directory. I ...
0
votes
3answers
32 views

Is there a way to know which files are being created, read or updated by running app? [duplicate]

I would like to list all files that have been read, created or updated from the app running.
2
votes
0answers
95 views

GLIBC not loading even after source compilation

While I am installing chef , I am getting below error. [root@centos Tools]# chef-server-ctl reconfigure /opt/opscode/embedded/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ...
0
votes
1answer
24 views

Whatis command (shell builtin vs executable programs)

I know that whatis command is used to output a brief description about an executable program (Command). So both whatis cd whatis type Will print: nothing appropriate (Because from my ...
0
votes
1answer
28 views

pv (progress bar) and gzip

Why is this not possible? pv ${dest_file} | gzip -1 pv is a progress bar error gzip: compressed data not written to a terminal. Use -f to force compression. For help, type: gzip -h 0 B 0:00:00 ...
3
votes
2answers
328 views

The type command can't distinguish between an executable command and a shell script

So I was reading the book The Linux Command Line, and it says that commands are of four types: (1) executable programs (2) shell builtins (3) shell functions (shell scripts) (4) ...
0
votes
1answer
48 views

Can I make alias for alias in bash?

In some circumstances, I need to make an official alias for a set of command, which acts just the same as the original software. Like: alias ipython3="source /Users/zen1/miniconda2/bin/activate py3k; ...
-3
votes
2answers
48 views

C Programming on command line [closed]

What to do after opening vim name.c and writing the source code? I mean, to compile and execute.
5
votes
8answers
400 views

Generate two sequences of numbers separated by “|”

I'm using bash (CentOS 5) and looking to generate this output (I assume I could use seq or echo together maybe?): 1|1, 2|2, 3|3, .... 31|31, 32|32, 33|33, I googled seq examples for over two hours ...
0
votes
0answers
27 views

Usage of the <<< operator [duplicate]

I recently ran across an example usage of the bc to output an expression like this: $ bc <<< "1+1" Which is the equivalent of: $ echo "1+1" | bc Does the <<< operator just ...
3
votes
1answer
128 views

How can I write data separately in many text files which contain the same fields?

I have a text file which contains around 9999999 lines. Here I'm pasting the few lines: 1874641047 Gazipur 1874646347 Jessore 1845105653 Chittagong 1845146123 Narayanganj 1845164162 Gazipur ...
2
votes
2answers
62 views

How to navigate the filesystem efficiently? [closed]

This question is on the "do everything through the terminal" mindset. I find navigating through the file system very inefficient. My typical workflow is: I want to go to ...
4
votes
1answer
89 views

How the terminal can run programs and show its output? [closed]

I'm slowly creating a mental model of how linux works, and I've tried to simplify the most, my model of how linux works. Let's assume that the kernel boots and inits the only software it's gonna run: ...
2
votes
2answers
70 views

How do I restore my boot partition manjaro/arch?

I need to completely rebuild my boot partition. The file system has sda1 250mb for boot and sda2 lvm luks encrypted with ManjaroVG-ManjaroHome, ManjaroVG-ManjaroRoot and ManjaroVG-ManjaroSwap inside ...
2
votes
1answer
28 views

How can I selectively modify the lines in a file where the modifications depend on analyzing the select lines as a whole rather than individually [duplicate]

TL;DR I need to align the columns of the entries in fstab while ignoring the comments: /dev/foo /foo ext4 defaults 0 2 # comment line 1 /dev/bar /bar ext4 defaults 0 ...
2
votes
1answer
68 views

Scroll by line in terminal rather than by page Shift + PgUp

Is there a keyboard way to scroll the terminal by line the same way we scroll with mouse wheel? Shift+PgUp/PgDown give only by-page scrolling. I would like to scroll slowly as with mouse wheel. My ...
1
vote
2answers
81 views

Remove file with pound signs around it [duplicate]

I am using SSH to another terminal with very limited disk space. upon typing ls I see a file called #korpus.txt#. I suspect this file is an emacs buffer, but upon running emacs and trying to kill it ...