Search Results

Search found 24211 results on 969 pages for 'shell command'.

Page 1/969 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Execute command from file in current shell

    - by Pandya
    I want to executed command from file (which is script) in current shell in terminal. Example: I have file ch_dir contains following: #!/bin/bash cd /usr Now if I execute file usually as following then it executes commands in different shell: pandya@pandya-desktop:~$ ./ch_dir pandya@pandya-desktop:~$ Here cd /user is executed in different shell. But I want to execute in Current shell. How do I do that? Note: Here cd is only used to explain. Question's aim is to execute any command in current shell

    Read the article

  • Learning the command line [duplicate]

    - by Billy
    This question already has an answer here: What is the best way to learn how to use Ubuntu with terminal? 3 answers This isn't really a technical question but I am curious as to how long it takes to learn the linux command line. I would like to learn how to be able to do as much as possible easily from the command line. I just bought a book, linux command line and shell scripting bible. I know that this book will be of great help, but i just have no clue how long it will be before i can successfully naviagte the terminal with ease. If you could post and let me know about your experience with the terminal, and the learning process, that would be greatly appreciated. Thank you in advance.

    Read the article

  • Upgrading to Gnome Shell 3.4 in Ubuntu 11.10 broke both Unity and Gnome shell

    - by mac
    I have upgraded my gnome shell to 3.4 in Ubuntu 11.10 through sudo add-apt-repository ppa:ricotz/testing sudo add-apt-repository ppa:gnome3-team/gnome3 sudo apt-get update && sudo apt-get dist-upgrade sudo apt-get install gnome-shell But it broke my system. Gnome shell is completely broken - When I login it just shows desktop wallpaper and nothing else. And importantly Unity is also broken. Attaching the screenshot Some main issues 1)Two menus are appearing now - Global menu as well as application menu 2)Icons on top-right panel are appearing weirdly 3)My Default Ambiance Theme also got screwed. Instead of black color menus, I am seeing white color menus. How do I fix them? Or Do I have an option to revert back to original settings or will reinstalling Unity/Gnome Shell helps ? Thanks

    Read the article

  • Auto-execute command after going to a folder with the CD command

    - by Patrick
    Is it possible to auto-execute a command in a folder if you move to it via the cd command? Of course I can define my own command (e.g. CHD.BAT) doing something like this: @echo off cd %1 if exist init.bat ( init.bat ) else ( color 0F title Command Prompt ) But I wonder if something like this would be possible using the standard CD command.

    Read the article

  • command to show the shell command prompt

    - by LinuxPenseur
    Hi, Is there a shell command to display the command prompt. I will explain what i want through the illustration below. When i execute script.sh, i should get the following output $sh script.sh $ /* command prompt and then print hi */ hi My script.sh is like this #! /bin/bash <command to display the shell command prompt> echo "hi" exit 0 what should the code that has to go in the place of angle brackets to get an output like above? Thanks

    Read the article

  • Run command in command prompt from Ruby application

    - by Julian
    I have a command-line Ruby application that uses Curses to create a GUI. This GUI is absolutely mangled by Windows' command prompt if the command prompt window is too small. The command prompt window can be resized in properties. However, I want to resize it programatically. Running this command in the command prompt (nothing to do with Ruby) will resize the command prompt window to desired variables. mode con:cols=120 lines=40 Can I do this purely in Ruby? Or, failing that (I suspect doing it purely in Ruby may be impossible) can my ruby application actually run that command and 'hit enter', and resize window it's running in?

    Read the article

  • Command to execute another command while replaying the command on STDOUT

    - by hakre
    It's not easy to formulate the question properly, maybe it helps when I describe what I'd like to do. I want to execute a command and pipe it's output into a tool called pastebinit which uploads the STDOUT output to pastebin. That works very well, however I would like to send the command itself on top of it but w/o typing it a second time. Is there some command I can launch "my command" with that will Print "my command" on STDOUT Executes "my command" I have the feeling that something like that exists but as hard as it is to formulate such a question properly, I was not able to dig it up with google so far.

    Read the article

  • Explanation of command to uppercase the first letter of a filename

    - by hazielquake
    I'm trying to learn to rename files with the command line, and after browsing around a lot of pages I finally found a command that uppercases the first letter of a file, but the problem is that I want to understand the meaning of each command. The command is: for i in *; do new=`echo "$i" | sed -e 's/^./\U&/'`; mv "$i" "$new";done I understand the 'for' kinda... but not the 'echo' or '`' and especially the sed command. if someone has a little patience to explain the meaning of each thing that'd be awesome! Thanks!

    Read the article

  • Sent command-line output as an arguments to other command

    - by pavelartlover
    1) Here is the command to install special package (for example system/header) #pkg install system/header 2) ALso we can install several packages #pkg install system/header network/ssh package/rpm 3) Here is the command to show all available packages from special group #pkg contents -o fmri -H -rt depend -a type=group solaris-desktop How to install all packages from a special group in one command? (How to send output from the third command as an argument to second?)

    Read the article

  • DB API for shell scripting (any shell)

    - by foampile
    I am faced with some legacy shell scripts that run batch data processing jobs in Oracle using SQL+. For the most part, the data tier does not have to communicate back to the script with retrieved data to be passed for shell-level processing but in a few cases it does. The problem is, SQL+ is really meant to be an end user app and not an API that can communicate with other clients programmaticaly. That is why people have invented APIs such as DBD::DBI for Perl, JDBC for Java, ODBC etc. The way it is done is they invoke SQL+ and then parse the output, which is clearly designed for human eye consumption, using tools like sed and awk. The whole thing is at best a hack and very prone to bugs. Since this client is rather conservative with their technology, they don't want to scale their scripts up to Perl or Python where there are data access APIs. So I am wondering whether there are similar APIs for shell, e.g. K or bash. What I would like is if an API would return data in a 2-dimensional array or strings (for the lack of type setting) so that I can just read DB data like that. The way they do it now is akin to parsing regular web page HTML to get a single stock quote rather than cleanly calling a web service and be done with it. Anybody know of a product I can use? Thanks

    Read the article

  • export command within shell script

    - by shantanuo
    When I use export command at command prompt, it works as expected. But it does not work from shell script. [root@server shantanu]# export myip=10 [root@server shantanu]# echo $myip 10 [root@server shantanu]# vi myip.sh #!/bin/sh export myipadd=10 [root@server shantanu]# sh -xv myip.sh #!/bin/sh export myipadd=10 + export myipadd=10 + myipadd=10 [root@server shantanu]# echo $myipadd I want to make the variable available to the same script next time when it runs. In other words I am looking for some way to memorize the variable value.

    Read the article

  • Installing gnome shell extensions from extensions.gnome.org fails silently

    - by Pascal
    On a fresh Ubuntu install (12.04, 64-bit), after installing gnome-shell, I've tried to install some extensions from extensions.gnome.org but got no result. I've tried with Firefox and Chromium and got the same issue. Open any extension page on extensions.gnome.org. Switch extension to "ON". Agree with confirmation about installation. Nothing happens and nothing has been installed (.local/share/gnome-shell/extensions is empty). I've checked .xsession-errors, Firefox's javascript console, gnome-shell console errors (Alt-F2 + looking glass). There isn't any trace of any error.

    Read the article

  • The Command Prompt is Outdated: 2 Command Prompt Replacements for Windows

    - by Chris Hoffman
    The Command Prompt window included with Windows is outdated. The command line itself isn’t outdated – the Command Prompt just lacks modern features like tabs, transparency, support for other shells, easy selection of text, and other modern Windows features. If you spend any time at all with the Command Prompt, you’ll want to check out one of these two open-source Command Prompt replacements that improves on the original Command Prompt. HTG Explains: Does Your Android Phone Need an Antivirus? How To Use USB Drives With the Nexus 7 and Other Android Devices Why Does 64-Bit Windows Need a Separate “Program Files (x86)” Folder?

    Read the article

  • How to install theme without using user-theme extension [Gnome Shell]

    - by Aventinus_
    I'm using Ubuntu 12.04 with Gnome Shell 3.4. Since day one I had some random crashes mainly after reloading or during search. After a lot of research I concluded that user-theme extension is to blame. Only when disabled Gnome Shell runs 100% smoothly. So my question is: Is there a way to install a theme without using user-theme extension? edit: Trying to install it via Gnome Tweak Tool without user-theme extension won't work because of [this][1].

    Read the article

  • Select (loop) or command not working in shell-script

    - by user208098
    I've been tinkering with Linux and Unix for years but still a novice in my mind and recently find myself trying to be more pro with it as I work in IT. So with that notion I'm studying shell scripting. I've hit a snag in ubuntu using the latest version 13.10 Saucy. When I use the select command in a sh script it doesn't work, depending on how I format the command it will either return Unexpected "do" or Unexpected "done". See the following two examples: This section of code produces an unexpected "do" error: #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit do case $opt in "option1") echo "you chose choice 1" ;; "option2") echo "you chose choice 2" ;; "option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done This section of code produces an unexpected "done" error. #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit ; do case $opt in "Option1") echo "you chose choice 1" ;; "Option2") echo "you chose choice 2" ;; "Option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done When I enter these parameters into the command line interactively or manually I get the desired result which is a list of choices to choose from. However when executed from a script I get the before mentioned errors. Also a side note I have tried this in Fedora as a script and it worked perfectly so my question is why isn't it working in Ubuntu, is this a difference between RHL and Debian? Or is it a bug in the latest version of Ubuntu? Thanks in advance for any help! KG

    Read the article

  • need to know about type of shell and which is best one?

    - by JK Patel
    i am new in the Ubuntu. And basically i am windows user, so i am searching about the feature of Ubuntu. then i got a word Named"Shell" so i searching about it and i get list of shell so i am confused which shell i use and which shell is generally used. so i want to know about the shell? how many type of shell are available in Ubuntu and which is best one among all@generaly used, featured and simple? thanks in advance!

    Read the article

  • How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

    - by slipheed
    I'm trying to set up a shell script so that it runs background processes, and when I ctrl+C the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It appears that kill 0 -INT also kills the script before the wait happens, so the shell script dies before the children complete. Any ideas on how I can make this shell script wait for the children to die after sending INT? #!/bin/bash trap 'killall' INT killall() { echo **** Shutting down... **** kill 0 -INT wait # Why doesn't this wait?? echo DONE } process1 & process2 & process3 & cat # wait forever

    Read the article

  • Batch deletion of smaller files from group of files via unix command line

    - by artlung
    I have a large number (more than 400) of directories full of photos. What I want to do is to keep the larger sizes of these photos. Each directory has 31 to 66 files in it. Each directory has thumbnails, and larger versions, plus a file called example.jpg I dispatched the example.jpg file easily with: rm */example.jpg I initially thought that it would be easy to delete the thumbnails, but the problem is they are not consistently named. The typical pattern was photo1.jpg and photo1s.jpg. I did rm */photo*s.jpg but it ended up some of the files named photoXs.jpg were actually larger and not smaller. Argh. So what I want to do is scan each directory for filesize and delete (or move) the thumbnails. I initially thought I'd just ls -R every file and extract the size of each file and save those under a threshold. The problem? In one directory the large will be 1.1 MB and the thumb is 200k. In another the large is 200k and the small 30k. Even worse, the files really are mostly named photo1.jpg - so simply putting them all in the same folder, sorting by size, and deleting in groups would not work without renaming already, and if it's possible I'd prefer to keep them in their folders. I was almost resolved to just doing this all manually, but then thought I'd ask here. How would you do this task?

    Read the article

  • split command on Ubuntu command-line

    - by pedro
    I want to split a file into multiple files with at most 25 lines each. I'm using this: split -l 25 /etc/adduser.conf > /home/ubuntu/PL/trab3/rc_ But I do not get the files I expect. How can I get files with filenames like rc_01, rc_02, etc.?

    Read the article

  • "find" command and piping its output through another program

    - by Charbel
    this is not an Ubuntu specific quesion, it applies to all unix/linux. how can I run a command like this: find . -maxdepth 1 -type d -print -exec svn info "{}" | grep URL \; the command above doesn't do what I want, I can't seem to pipe the output of the svn info to grep. This works, but the output contains much more than I need: find . -maxdepth 1 -type d -print -exec svn info "{}" \; Any ideas?

    Read the article

  • What does /dev/null mean in the shell?

    - by rishiag
    I've started learning bash scripting by using this guide: http://www.tldp.org/LDP/abs/abs-guide.pdf However I got stuck at the first script: cd /var/log cat /dev/null > messages cat /dev/null > wtmp echo "Log files cleaned up." What do lines 2 and 3 do in Ubuntu (I understand cat)? Is it only for other Linux distributions? After running this script as root, the output I get is Log files cleaned up. But /var/log still contains all the files.

    Read the article

  • C Minishell Command Expansion Printing Gibberish

    - by Optimus_Pwn
    I'm writing a unix minishell in C, and am at the point where I'm adding command expansion. What I mean by this is that I can nest commands in other commands, for example: $> echo hello $(echo world! ... $(echo and stuff)) hello world! ... and stuff I think I have it working mostly, however it isn't marking the end of the expanded string correctly, for example if I do: $> echo a $(echo b $(echo c)) a b c $> echo d $(echo e) d e c See it prints the c, even though I didn't ask it to. Here is my code: msh.c - http://pastebin.com/sd6DZYwB expand.c - http://pastebin.com/uLqvFGPw I have a more code, but there's a lot of it, and these are the parts that I'm having trouble with at the moment. I'll try to tell you the basic way I'm doing this. Main is in msh.c, here it gets a line of input from either the commandline or a shellfile, and then calls processline (char *line, int outFD, int waitFlag), where line is the line we just got, outFD is the file descriptor of the output file, and waitFlag tells us whether or not we should wait if we fork. When we call this from main we do it like this: processline (buffer, 1, 1); In processline, we allocate a new line: char expanded_line[EXPANDEDLEN]; We then call expand, in expand.c: expand(line, expanded_line, EXPANDEDLEN); In expand, we copy the characters literally from line to expanded_line until we find a $(, which then calls: static int expCmdOutput(char *orig, char *new, int *oldl_ind, int *newl_ind) orig is line, and new is expanded line. oldl_ind and newl_ind are the current positions in the line and expanded line, respectively. Then we pipe, and recursively call processline, passing it the nested command(for example, if we had "echo a $(echo b)", we would pass processline "echo b"). This is where I get confused, each time expand is called, is it allocating a new chunk of memory EXPANDEDLEN long? If so, this is bad because I'll run out of stack room really quickly(in the case of a hugely nested commandline input). In expand I insert a null character at the end of the expanded string, so why is it printing past it? If you guys need any more code, or explanations, just ask. Secondly, I put the code in pastebin because there's a ton of it, and in my experience people don't like it when I fill up several pages with code. Thanks.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >