Questions tagged [shell]

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion.

Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

The name was first used by Unix operating system for an interpreter used for command prompt, but currently the term shell refers to BASH(Bourne Again SHell) and other command prompt interpreters too.

1348 questions
10
votes
2 answers

Symbolic link and sudo

I create a symbolic link: ln -s /tmp/folder1 /tmp/folder2 Then I go to /tmp/folder2 and run pwd: $ cd /tmp/folder2/ $ pwd /tmp/folder2 $ sudo pwd /tmp/folder1 # <-- This is the odd part Why does pwd with sudo give the original directory? I'm…
iDev247
  • 751
  • 1
  • 12
  • 23
10
votes
5 answers

How do I change to the directory I just moved that file to?

So lets assume I've just done: mv ./myfile /to/some/other/place/ And I now decide I want to follow the file, and go into that directory. Whilst I could head for the mouse, select the text, type 'cd ', then right-click to paste - I'd prefer a faster…
Peter Boughton
  • 594
  • 2
  • 7
  • 19
10
votes
2 answers

SFTP: Move (rename) many files from one folder to another (not one by one)

I need to move all the files from current_path to current_path/DestinationFolder. The version of SFTP I'm using is: SFTP protocol version 2 The available commands are: sftp> help Available commands: cd path Change remote…
user124736
10
votes
5 answers

Encoding to base32 from the shell

I'm looking to encode an input string to base32 encoding directly from the shell. I'm looking to do this in ubuntu, but I imagine flavor doesn't particularly matter here. Are there any existing linux/unix tools out there to simply do…
jdev
  • 205
  • 1
  • 2
  • 8
10
votes
2 answers

Terminal only shows $?

I recently set up a new user using "adduser username" on my server and noticed that when I login I get: $ Also, with my new user there is no folder highlighting, or tab completion. However when I login as root I get a full terminal prompt plus…
kidcapital
  • 847
  • 2
  • 8
  • 10
10
votes
4 answers

How do I setup SFTP for sites without giving shell access?

I'd like to use SFTP for all the sites on my cPanel CentOS server as we had an FTP password hacked before (not hard). However I don't want each sites SFTP account to have shell access (not even jailed shell). Is this possible and how? I'm quiet new…
firefusion
  • 303
  • 2
  • 3
  • 8
10
votes
4 answers

Move files from subfolder to current folder

Say my files on a Ubuntu server are like: /folder1/folder2/ I am in folder1 currently, and I want to move all files/folders (recursive) from folder2 to the current folder. How can I do this?
Blankman
  • 2,891
  • 10
  • 39
  • 68
10
votes
1 answer

How to close GUI and go into pure shell mode in RedHat enterprise Linux 6?

I'm new to linux. How to close GUI and go into pure shell mode in RedHat enterprise Linux 6? I don't want the GUI. I just want to learn some shell scripts. Thanks.
Yousui
  • 245
  • 3
  • 4
  • 9
10
votes
6 answers

Prune duplicate entries from PATH variable

I modify my .bashrc frequently and then source it. However, when I have things like export PATH="~/bin:~/perl5/bin:$PATH" in my file, then the PATH environment variable grows every time I source the file. For example, the first time .bashrc is…
10
votes
5 answers

Most simple way of extracting substring in Unix shell?

What's the most simple way to extract substring on Unix shell (with regex)? Simple means: less feature less options less study Update I realized regex itself is conflicting with simplicity, and I chose the simplest one cut as the chosen answer. I…
Eonil
  • 10,459
  • 16
  • 36
  • 54
10
votes
2 answers

Override LDAP shell

I have a LDAP server and a predefined shell (bash) set in it. But there are some machine on which I want a different shell to be used whenever user login to that instead of the shell stored in LDAP. How can I do this?? Can someone give me some…
Incredible
  • 151
  • 1
  • 1
  • 5
10
votes
7 answers

Why is this file hidden when you run ls?

EDIT: I totally forgot about this thread. It turns out I had a bad hard disk. We had to redeploy this server for other needs so I finally got around to replacing the one bad disk and we're back in business. For a few weeks now I couldn't figure out…
sdot257
  • 3,059
  • 5
  • 30
  • 39
9
votes
3 answers

Database accidentally deleted with a bash script

Edit: a follow-up question: Restore mongoDB by --repair and WiredTiger. My developer committed a huge mistake and we cannot find our Mongo database anywhere in the server. He logged into the server, and saved the following shell under…
9
votes
4 answers

Why can't I capture AWS EC2 CLI Output in Bash?

I am trying to capture the output of an aws ec2 delete-snapshot in a Bash script command but I cannot get anything to capture the output. I have tried result=$(command), result=`command` etc. but when I try to echo $result there is nothing…
JoshZ
  • 93
  • 1
  • 1
  • 3
9
votes
2 answers

Expect script error send: Spawn id exp4 not open while executing

I'm trying to run this script but having different errors when modified. Here is the code and the output. Please help. Updates at the end of the post with debug info #!/bin/bash (( $# != 1 )) && { echo >&2 "Usage: $0 \"[COMMAND]\""; exit 1;…
GoldFlake129
  • 103
  • 1
  • 1
  • 6