Need Linux help please

Computer Science
Tutor: None Selected Time limit: 1 Day

hi. I was wondering how can a ls command with an argument of the absolute pathname of two? Also how do you make your home directory the working directory. How do you give the ls command with an argument of two to display the contents of the two directory? Thanks

Jul 17th, 2015

Thank you for the opportunity to help you with your question!

In Linux and Unix systems, commands are executable files. The commands may be specific with user environment.We can set the absolute path of specific command as per user in environment.If we require the information, to get the absolute path of command. In that case we will use which command.

To find the absolute path of command in Linux/Unix system, we use which command.


Syntax:

which command-name

OR

which executable-file-name

Note: The echo $PATH command will show the directory path. The which command, locate the command from these directories.

For example:

root@tuxworld:/# echo $PATH
/usr/local/rvm/gems/ruby-2.1.0/bin:/usr/local/rvm/gems/ruby-2.1.0@global/bin:/usr/local/rvm/rubies/ruby-2.1.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin
root@tuxworld:/# 

Example : In this example,we will find the absolute path of useradd command.
The output from which command is showing the absolute path.

root@tuxworld:/# which useradd
/usr/sbin/useradd
root@tuxworld:/#

ls lists files and directories. If the pathname is a file, ls displays information on the file according to the requested options. If the pathname is a directory, ls displays information on the files and subdirectories therein. You may obtain information on a directory itself using the -d option.

If you do not specify any options, ls displays only the file name(s). When ls sends output to a pipe or a file, it writes one name per line; when it sends output to the terminal, it uses the -C (multi-column) format.


Please let me know if you need any clarification. I'm always happy to answer your questions.
Jul 17th, 2015

Thank you.

Jul 17th, 2015

how do you open up a terminal emulator window? I thought I could do this by logging into my school's unix server.

Jul 17th, 2015

Hi, this is how you can open up a terminal emulator window:

Shell Terminal Emulator. This app is a terminal for Android phones. You can access your Android's built-in Linux command line shell, and use many available commands (Linux/Unix) in your device. It allows you to browse your phone, create or delete files and directories.

Jul 17th, 2015

what about gedit editor

Jul 17th, 2015

I hope the sent solution will be of much help to you.

Welcome.

Jul 17th, 2015

I am trying to start on this lab called editing text files using gedit, nano, and vim, but i don't know how to open  the window

Jul 17th, 2015

Text Editor (gedit) is the default GUI text editor in the Ubuntu operating system. It is UTF-8 compatible and supports most standard text editor features as well as many advanced features. These include multilanguage spell checking, extensive support of syntax highlighting, and a large number of official and third party plugins.

gedit is suited for both basic and more advanced text editing and is released under the GNU General Public License.

gedit is located in Ubuntu's Main repository and is installed by default. gedit can be installed in Kubuntu, Xubuntu and other distributions although additional libraries are necessary and will be installed on non-GNOME systems.

To install gedit:

  • Select gedit in Synaptic (SystemAdminstrationSynaptic Package Manager)

  • From a terminal or ALT-F2:
    sudo apt-get install gedit

gedit incorporates a graphical user interface (GUI) and is opened by going to ApplicationsAccessoriesText Editor or by pressing Alt+F2 and typing gedit

Opening gedit via the command line allows the user to take advantage of several options unavailable from the GUI menu. If a path is not included in the startup command, gedit will look for the file in the current directory. If the file is not found, gedit will open a blank file with the file name entered on the command line:

  • To open a specific file:

    gedit filename
  • To open multiple files:

    gedit file1 file2
  • To edit system files such as sources.list and fstab, open it with administrative privileges. Note graphical applications use gksudo rather than sudo.

    gksudo gedit
  • To open at a specific line number, useful when an error message includes the line number, include "+<line number>". (gksudo is used in this example since the file is a system file owned by root):

    gksudo gedit +21 /etc/apt/sources.list

Several popular options which the user may wish to review after the initial installation are:

  • Create Backup Copy: EditPreferencesEditor tab. This option is enabled by default and creates a copy of the file before saving changes. Backup files saved in this manner are appended with a trailing "~". If the user does not want gedit to back up files in this manner, deselect the option.

  • Autosave: EditPreferencesEditor tab. This feature is not enabled by default. The user may also select the time between autosaves.

  • Spell Checker: EditPreferencesPlugins tab. This feature is enabled by default.

Plugins greatly enhance the power of gedit and are are accessed via EditPreferencesPlugins. More than a dozen plugins are pre-installed and can be enabled/disabled in this section. Some of the most popular are enabled by default while others must be enabled by the user.

  • Tag List. Displays common tags in a side pane and allows for easy insertion into the file.
  • External Tools. One of the powerful default plugins available (but not enabled by default), External Tools allows the user to run external commands on the file being edited from within gedit itself.

    • Once this plugin is enabled, the user can select custom tools from the Tools menu.

    • The addition of shortcut keys and the configuration of tools from the External Tools Manager are accomplished via the ToolsExternal Tools... menu.

For descriptions of standard plugins distributed with the gedit package visit this link.

Many additional plugins are available from third-party resources. See the Links section near the bottom of this page.

A very useful feature of gedit is the ability to color programming code. Using syntax highlighting makes simple errors easier to recognize. gedit uses the GtkSourceView for syntax highlighting. The .lang file for a specific programing language is located in the /usr/share/gtksourceview-3.0/language-specs/ folder. These files may be edited or additional files created to further define the highlighting definitions.

Syntax highlighting is automatic and is selected in one of two methods. It can be chosen via the menu with View, Highlight Mode or via the lower statusbar. The statusbar, enabled via the View menu, displays programming language options for many types of sources, scripts, markup and scientific formats. A screenshot of the statusbar in use is located further down this page.

gedit provides a user-friendly way to make XML markup or Docbook XML for yelp and ubuntu documentation. The pictures and instructions given below use gedit 2.26.1. The recommended changes help take full advantage of the syntax color highlighting which gedit provides.

  • Under the View tab make the following selections. Selecting most of the options just make life easier.

  • The next change to make is under Editor tab. As one can see there is not much to do here.

  • Next is the Plugins Tab. A screenshot of the plugins tab is available in the Plugins section above. There are a number of changes you can make on the Plugins page, the most important perhaps is the Tag List option. Experiment with other plugins and see what they do. This link gives a brief explanation of each default plugin.

  • Now comes the most interesting part, go to View > Highlight Mode > Markup and while we want Docbook one can also see XML and both look slightly different from each other:

    [img alt="geditdocbook2.png" class="attachment" src="https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditdocbook2.png" title="geditdocbook2.png">

The above one is when the text is highlighted using geditdocbook. The same text when highlighted using XML looks like:

Experiment with gedit's settings and markup in general to have a feel of what works best for you.

If you are running Ubuntu and attempt to remove gedit via Synaptic or apt, the system will also attempt to remove the ubuntu-desktop metapackage. If you try to remove ubuntu-desktop specifically in Synaptic the user will be cautioned with:

  • This package depends on all of the packages in the Ubuntu desktop system. 
    It is also used to help ensure proper upgrades, so it is recommended that it not be removed.
If the user is experiencing problems with gedit, it may be preferable to first reset the user's preferences by removing the user's .config/gedit folder rather than attempting to remove the entire application and the ubuntu-desktop metapackage. Learn more about Ubuntu's MetaPackages.

Jul 17th, 2015

Whew. Thank you. Lol.

Jul 17th, 2015

welcome. Let me send you how you can edit text files using nano and vim

Jul 17th, 2015

HOW TO EDIT A TEXT FILE USING NANO AND VIM:

1.) nano

Nano is a very easy-to-use free pico clone that comes installed by default in Ubuntu. This is definitely a great console text editor for those who are unfamiliar with more advanced ones such as vim.

To use nano to edit a file, do the following in a terminal, where 'filename' is the name of the file you want create or modify:


nano filename

The important command shortcuts are displayed at the bottom of nano's screen, denoted by a ^ and a shortcut character. The ^ stands for the Ctrl character on your keyboard. For example, the exit shortcut on nano is ^X, so to exit nano you would hold down Ctrl and press x.

For more information on this editor, please see the documentation (http://www.nano-editor.org/docs.html).


ee and aee

ee (Easy-Edit) and aee (Advanced Easy Editor) are two similar very easy to use console text editors. Like nano, keyboard shortcuts are performed by holding Ctrl and pressing the correct shortcut keys. Common shortcuts are listed at the top of the screen. There is also a handy menu system that can be accessed by pressing Esc.

Of the two, I prefer aee simply because the main menu loads slightly faster. Apart from that, their keyboard shortcut sequences are slightly different, but all the shortcuts are listed at the top of the screen. ee is the default text editor of FreeBSD (http://www.freebsd.org/).

To install these editors, you will need to enable the Universe repository (http://www.ubuntuforums.org/showthread.php?t=179).

After doing so, open a terminal and do the following to install ee:


sudo apt-get install ee

Or, for aee:


sudo apt-get install aee

To create or modify a file with these editors, do the following in a terminal, where 'filename' is the name of the file you want to edit or create:


ee filename

Or, for aee:


aee filename


2.) vim

This powerful vi clone is installed by default on nearly all Linux systems, including Ubuntu. It has many advanced features such as syntax highlighting (a feature that color codes key words in programming languages and configuration files). If you prefer a more feature-packed text editor than nano and the rest, this is a good one.

To use vim to edit a file, do the following in a terminal, where 'filename' is the name of the file you want to create or modify:


vi filename

or


vim filename

To get syntax highlighting to work, do the following in a terminal:


cp /usr/share/vim/vim63/vimrc_example.vim ~/.vimrc

Jul 17th, 2015

Contact me whenever you experience any difficulty. I humbly request that you kindly add to me even some few dollars in addition to the one dollar you gave me for the first question. Remember am here to help you 24 hours, my interest is to see you succeed in your work and studies.

Thank you for that consideration.

Jul 17th, 2015

Thank you so much. I will keep that in mind. I didn't know I had gave you a $1.00

Jul 17th, 2015

You are most welcome.

I will highly appreciate that.

Jul 17th, 2015

Hello, hope you are doing quite fine.

I was just checking on how far you have reached with the consideration you were supposed to do me concerning some money increment on the question I helped you in.

I will be more than glad to receive it.

Thank you.

Jul 21st, 2015

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Jul 17th, 2015
...
Jul 17th, 2015
Dec 8th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer