General :: Show Only The Parent Folder In The Shell Prompt?

Aug 8, 2011

Whenever I go inside a directory in Linux, it shows the file path at prompt like:

root@vivek-HP-Pavilion-dv6-Notebook-PC:/var/www/abc/def/

How can I change it to show short names instead?

View 1 Replies


ADVERTISEMENT

General :: Configure Bash Prompt To Show Current / Parent Directory Only

Oct 15, 2010

I would like to modify Bash Prompt so it does not show the whole $PATH but just the current and parent directory. I am using Ubuntu.

View 3 Replies View Related

General :: Finding A Recursive Shell Or Perl Script To Delete Files With The Same Name As The Parent Folder?

Jun 29, 2010

is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.

View 2 Replies View Related

General :: Unix - Making Shell Prompt Show Last Return Value

May 30, 2011

I'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple).

My own computer doesn't have this, how can I configure it? I'm using Xubunto, if more details are needed let me know -- I'm not much of a Linux user (I don't know what's relevant here).

View 3 Replies View Related

General :: Command Line - Move Folder Contents Into Parent Folder

Jun 11, 2010

I have a folderA that contains folderB that contains a lot of files. I would like to get rid of folderB, but not its contents. I want those contents to be inside of folderA. How can I accomplish this on the commandline?

View 2 Replies View Related

Software :: Export A Variable To Parent Shell In Shell Scripting?

May 21, 2009

Is there a way to export a variable to parent shell in shell scripting ?

View 3 Replies View Related

General :: Cannot Inherit The Permission From Parent Folder To Child

Apr 26, 2011

I have setgid permission on my home directory (/home/XXXX) the permission look like below.

Code:

drwxrws--- 2 toshi jadu 4096 Apr 26 16:54 getset

If I create new directory in this getset folder the permission of getset folder could not inherit.

Code:

#cd getset
#mkdir test2
#ls |grep test2
drwxr-s--- 2 toshi jadu 4096 Apr 26 16:56 test2

As I know the setgid utility allow to inherit the permission from parent directory to child directory.

View 4 Replies View Related

General :: Copy Files From One Folder To Another Folder Using Shell?

Mar 4, 2010

i need to copy files from a folder called output files to another folder called running but im not able to do it i always get a stat error

View 14 Replies View Related

General :: Coloring The Z Shell But Don't Color Prompt

Mar 7, 2010

Because I have to stare at my command prompt all the time on my computer, it should look at least half-decent, so I am trying to get it colored. The expected outcome is as seen on this site. I have the colors I want set in my .Xdefaults file, but they of course do not color my prompt.

[Code]....

View 1 Replies View Related

General :: How To Minimize Bash Shell Prompt

Oct 26, 2010

Currently the terminal prompt looks like this:[karlis@karlis-desktop current_folder]$How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets?I checked the preferences for the default Gnome-Terminal and Terminator - there are no settings for this. It is pretty hard to use terminal when working in directories with long names.

View 1 Replies View Related

General :: Change My Default Shell Prompt?

Jul 8, 2010

I have looked almost everywhere for how to change my default shell prompt. When I open my bash shell, the prompt is [fedora-dev@Fedora-Dev Documents]$. I would like it to open at fedora-dev@Fedora-Dev]$.

Can someone tell me where to change this at. I have looked in .bashrc, etc/profile, and environmental variables.

View 6 Replies View Related

General :: Shell Script To Prompt Customer ?

Oct 20, 2010

I need to create a shell script called 'custinfo' to prompt a customer to enter and display back the following: name, age, address, phone number, and product.

Below is what i have so far.

View 7 Replies View Related

General :: Shell Script To Prompt For Input

Jun 14, 2011

I would like to run some existing scripts and send it to a text file:

Note: 'script' is an exist shell script
Note: '/opt/2011jun15/my.db' auto generates everyday with only changes to the directory 2011jun15 base on the current date

currently i will need to run the script manually and make changes to the path below, change directory name 2011jun15 daily and text file new2011jun15.txt ./script -f /opt/2011jun15/my.db > new2011jun15.txt

Am i able to write a shell script to prompt me for a change of path for only '2011jun15' and 'new2011jun15.txt'?

It will be great if i can automate the whole process?

View 11 Replies View Related

Programming :: Communicating From Subshell To Parent Shell

Mar 17, 2010

I am stuck at a issue in shell scripting. I had tried all the possible ways, yet unable to reach a solutions. I am working on a application, which runs on C shell. For this I had created a installation script, which installs my application in the system, it is working fine. Now, the problematic part is that I had set an alias in ".cshrc" file, which invokes my application when any user types it. But for an alias to take effect, I need to re-login into the system, because I have to read ".cshrc" file again, in order to take effect of my alias. However I can use "source ~/.cshrc" file after my installation, so that my aliasing works without logging back again. But Requirement is that, just after installing the application, alias should be available to user, without logging back again and without issuing any extra command.

I had tried one other way is that, I had created a symbolic link in ~/bin directory, which points to my application to be run, but even that require, to issue rehash command in order to modify internal command hash table. So, my overall problem is that changing alias in subshell should be reflected to parent shell,without running any other command (all commands should be run in installation script only). Or, in other way how to rehash parent shell from subshell. The ultimate requirement is that,the command that will run my application, should be available just after executing the installation script, either by aliasing or by rehashing, or by any other means.

View 9 Replies View Related

Ubuntu :: Where Is My Parent Folder

Jul 26, 2010

Where is my parent folder?

View 1 Replies View Related

Software :: Nested Shell - Disown Job Not Found (Parent Or Child)

Jun 1, 2011

I'm in a nested shell trying to use disown to re-root myself as well as a child. Looks like this:

Code:
# echo $$
1234
# disown 1234
disown: job not found: 1234
# disown $$
disown: job not found: 1234
# pgrep mychild
2222
# disown 2222
disown: job not found: 2222

This is in zsh. The goal is to have process 1 (the root of all processes) to become the parent.

View 3 Replies View Related

OpenSUSE :: Zip A Folder But Not Include It's Parent Directories?

May 11, 2011

I use "zip -r" to zip the following folder:

/root/Desktop/administration/backup

....My only grip is that when you open the zip file, the parent directories are there too.

So within the zip file I have to navigate through "/root/Desktop/administration" just to get to the directory called backup.

Is there a way for me to zip the directory backup, and not include the parent directories? I want to be able to open the zip file and see only the backup directory listed.

View 9 Replies View Related

Ubuntu :: Can't Navigate To Parent Folder In Nautilus?

Feb 5, 2010

I used to be able to open any folder in Nautilus and from there navigate to the parent folder. There was this arrow pointing up that had this function but I don't have the option any more.

View 9 Replies View Related

Ubuntu :: Keep Files, Remove Parent Folder?

May 7, 2011

Im pretty new to linux and Ive hit a wall. I have a folder 'forum'. I need all files and subfolders but I dont want them in forum. I have tried it with the gui, but it wont let me paste them. How do I move all the folder data without moving the folder itself via terminal?

View 4 Replies View Related

Programming :: Shell Script To Automatically Delete Files With The Same Name As The Parent Directory?

Mar 18, 2010

I am facing a problem in Windows due to a virus called Newfolder.exe which creats files with the same name as it's parent directory and an extension .exe and this happens for every directory in the entire hierarchy in the infected pen drive. The antivirus detects them, but is sucking slow. So I thought this is a good opportunity to use the concepts of the all mighty shell script to remove those as they follow the same pattern. Say my complete path is

Code:

/home/pkd/fol1/

The virus would have created an file with complete paths

Quote:

/home/pkd/fol1.exe

If fol1 has two more directories fol11 and fol12 Then there would be two more .exe(virus created) in the following path

Quote:

/home/pkd/fol11/fol11.exe
/home/pkd/fol12/fol12.exe

View 1 Replies View Related

Ubuntu :: Inherit Parent Folder Permissions When Copying Files ?

Mar 28, 2011

I do have an Ubuntu Headless server which is running Samba on it. My mp3 file collection resides on that server on is being share.

So far, no problems connecting to that drive and writing from my Windows box on that share. But if I use my main laptop, which runs Ubuntu Lucid and download an mp3 song from Amazon, the moment I move that to the share, I got permissions problems from the Windows machine. This is clearly a permission issue with group and others; the song is being created on the share without read and write permissions to others or the samba group I created.

My question is. How can I make this process simple or automatic, when moving songs to the share? I don't want to go there everytime and run ...

Code:

Which was basically how I reset or fixed the problem.

I've read about umask, but not sure if that applies here or not, because I'm not creating the file but moving it.

View 5 Replies View Related

Ubuntu :: Collapsing The Contents Of Sub Folders Into The Parent Folder Via Terminal?

Aug 4, 2011

I have a parent folder, with a lot of sub folders. basically, i'd like to bring all the contents from the sub folders into the parent folder, and subsequently delete the sub folders. is there one command for this? or do i need to cp -r over and over again, and then manually delete?

View 1 Replies View Related

Programming :: Bash - Recursive Find - Create Parent Folder - Moving File

Dec 5, 2010

I'm starting bash shell script and I'm looping without any solution.

I'm trying to find some files under a folder hierarchy and in case of errors moving these files to a destination folder under the same hierarchy recreating this hierarchy if not exists.

Finding all ._* files under /src and moving them to /dest recreating folder1 or the others which contains ._* files but without moving files which does not correspond to the pattern.

Code:

I tried find command and I'am getting all needed files

Code:

But I don't know how to use the output to get the parent folder of files which are found to

1- create folder with mkdir -p /dest/folder1 or /dest/folder1/folder4

2- move found files from /src/... to /dest/... with rm command

I'm working on a find command as this trying to do all in the same line but ... little lost

Code:

View 8 Replies View Related

Ubuntu :: /usr/local/bin/compiz-indicator:99: GtkWarning: Can't Set A Parent On Widget Which Has A Parent

May 3, 2011

I keep getting a segfault in compiz. I've tried everything! This is from a fresh install without and accelerated drivers (I have ATI)

Quote:

Code:

**Switching to Compiz window management**
/usr/local/bin/compiz-indicator:99: GtkWarning: Can't set a parent on widget which has a parent
menu.append(kill)
/usr/local/bin/compiz-indicator:100: GtkWarning: Can't set a parent on widget which has a parent
menu.append(start)

[code]....

View 2 Replies View Related

General :: Nautilus Does Not Show A Folder/directory?

Apr 1, 2010

Yesterday after downloading a file I tried to find it on the desktop where downloaded files are saved. It does not appear in nautilus but when I look for it from command line it appears to be there. I simply do 'ls' for this and that means its not hidden.Googled it for an hour to find a suitable answer but most of the posts focus on removing the in front of file name which is not the case here.

View 13 Replies View Related

General :: Show The Number Of File On Folder?

Oct 21, 2010

My folder have some files and I want to show the number of files on folder at "Total file on folder: " Ex: Monday folder have six files and it will show "Total file on folder : 6" when I run a script. This is my code :

#!/bin/sh
if [ -d /home/kenzo/Monday/ ] && {
echo "Monday"
ls -l /home/kenzo/Monday/

[code].....

View 2 Replies View Related

General :: Show Size Of Folder Contents In Ls Or Some Other Command

Sep 29, 2010

I know these folders each have >80gb of files. Yet, they only show 4.0K in ls -lah? How can I have ls show size including the contents?

[root@aapsan01 aapxen01]# ls -lah
total 48K
drwxrwxrwx 6 root root 4.0K Sep 29 03:45 .
drwxrwxrwx 15 root root 4.0K Sep 27 09:15 ..

[Code]....

View 4 Replies View Related

General :: Show Folder And Only One Subfolder Using Ls In Command Line?

Jul 13, 2011

I have many folders with many subfolders. All I want it to get the folder name and the first subfolder. I tried using ls -R but this give me more than I want it. Let say I have:

dir1/subdir1/sub_1_1/file.a
dir1/subdir1/sub_1_1/file.a2
dir1/subdir1/sub_1_1/file.a3

[code]....

All I want when I execute the command is to show me:

dir1/subdir1
dir1/subdir1
dir1/subdir2

[code]....

View 4 Replies View Related

Ubuntu Servers :: Show Folder Contents In Another Folder?

Feb 2, 2011

can i use one samba share with a folder showing the contents of another directory.shortcuts don't work on non ubuntu systems and it won't resolve links to files no on the share

View 5 Replies View Related

General :: Create A New Mysql User And A Mysql Database At The Shell Prompt?

Aug 7, 2010

How do I create a new mysql user and a mysql database at the shell prompt?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved