- 6 Ways to Open Folders in Ubuntu 20.04 LTS
- Open a Folder In the File Manager (Nautilus)
- Search and Open a Folder through Dash
- Open a folder In the command line (Terminal)
- The tilde (`) symbol
- The ‘/’ symbol
- The ‘..’ symbol
- The ‘-’ symbol
- Open a folder in the Terminal through the File Manager
- Open a folder in the File Manager through the command line
- Access a Folder as Administrator from the File Manager
- Install Nautilus Admin
- Opening a Folder as an Administrator
- Karim Buzdar
- How to open a folder in linux via terminal? [closed]
- 5 Answers 5
- Opening current directory from a terminal onto a file browser?
- 4 Answers 4
- How to open and close directories in the Linux terminal | Opensource.com
- Learn how to use the cd command to change directories with this Linux tutorial.
- Subscribe now
- Close a folder
- Topics
- About the author
- Recommended reading
- 1 Comment, Register or Log in to post a comment.
- Subscribe to our weekly newsletter
- Footer
6 Ways to Open Folders in Ubuntu 20.04 LTS
Opening folders in Ubuntu is one of the basic tasks you will perform as a regular Ubuntu user. Although there are many ways to do so, we all have our preferences in which way to opt for when accessing folders on our system.
In this article, we will explain some ways to:
- Open a Folder In the File Manager (Nautilus)
- Search and Open a Folder through the Dash
- Access a folder In the command line (Terminal)
- Open a folder in the Terminal through the File Manager
- Open a folder in the File Manager through the command line
- Access a Folder as Administrator from the File Manager
We have run the commands and procedures mentioned in this article on a Ubuntu 20.04 LTS system.
Open a Folder In the File Manager (Nautilus)
The latest versions of Ubuntu, like Ubuntu 20.04 LTS or Ubuntu 21.04, come with a default file manager by the name of Nautilus. This open-source file manager created for our GNOME desktops gives us a way to manage our files and folders.
You can access the Nautilus File Manager in the following ways:
1.Searching for the term ‘Nautilus’ from the system Dash:
2. Searching for the term Files or File Manager from the system Dash:
3. Accessing the File Manager from the Files icon in the Ubuntu Dock/Activities panel.
The File Manager opens in your Home folder by default. In Ubuntu you can open your required folder by double-clicking it, or by choosing one of the options from the right-click menu: Advertisement
- Open
- Open In New Tab
and,
- Open In New Window
Search and Open a Folder through Dash
The Dash search lets you open a folder directly, rather than browsing it from the File Manager. Simply type the folder name in the Dash and the search results will display based on your criteria.
Through a simple click, you can open the relevant folder(see the path in case multiple search results show).
Open a folder In the command line (Terminal)
The Ubuntu command line, the Terminal is also a non-UI based approach to access your folders. You can open the Terminal application either through the system Dash or the Ctrl+Alt+T shortcut.
Here are some of the commands and symbols that will help you in browsing folders in the command line:
The cd or change directory command allows you to change your directory, or in other words, open a new folder. When you open the Terminal, you are in your home directory. The following command will help you in opening the folder of your choice:
In the above image, we have first listed the folders in the current directory through the ls command and then opened the Downloads folder through the cd command. The command prompt of the Terminal, by default, shows the current folder you are in.
The tilde (`) symbol
The tilde symbol represents our home directory. You can use this symbol in the cd command to move to a folder in your /home/[user]/ directory.
In the following image, I will open the snap folder from my home directory, and then directly open the Downloads folder from my home directory by using tilde:
The tilde symbol here has helped me in avoiding going back to the home folder first and then opening the Downloads folder.
The pwd command stands for print working directory. If you want to know the exact directory path you are currently in, simply use the following command to do so:
The ‘/’ symbol
The / symbol with the cd command helps you in directly opening the root folder.
The ‘..’ symbol
The ‘..’ symbol with the cd command helps you in navigating up one directory level:
The ‘-’ symbol
The ‘-’ symbol with the cd command helps you in going back to the previous folder you were in, before navigating to the current folder. You can think of this command as the ‘Previous Channel’ button on your tv remote control.
In the following example, I was in the /home/user/Downloads folder. Then I used the ‘..’ symbol to go back to my home folder. Now if I want to go back to the Downloads folder, I can use the following command to go back to the Downloads folder:
Open a folder in the Terminal through the File Manager
In order to open a folder from the File Manager to your Terminal application:
Right-click the selected folder and select Open in Terminal from the menu as follows:
Open a folder in the File Manager through the command line
If you are in the Ubuntu command line and want to open a specific folder in the UI File Manager, you can use one of the following two ways:
or
Access a Folder as Administrator from the File Manager
While working with files and folders as a Linux Administrator, we frequently need to access and edit files and folders that require root permissions. We usually perform this task through the Ubuntu Terminal(the command line utility) using the sudo function. Here is a workaround to do the same through Nautilus Admin application.
Install Nautilus Admin
The following steps will help you in installing the Nautilus file manager to your Ubuntu system:
Open the Terminal through Ctrl+Alt+T or through the Ubuntu dash.
Run the following command as an administrator:
Enter Y when prompted about the use of additional disk space.
Nautilus Admin will be installed on your system. You can open it by entering Nautilus in your Ubuntu Dash as follows:
The file manager in your system is now Nautilus Admin.
Opening a Folder as an Administrator
Let us suppose that you need to open a folder that requires root permission. You can access the folder through the UI file manager; right-click and then select Open as Administrator from the menu.
In this example, we want to access the root folder from Other Locations. Since this folder requires root privileges, we will access it as follows:
You will be asked to provide authentication information, after which you will be able to access the contents of the folder.
By now, you must have mastered accessing your Ubuntu folders both through the command line and the UI. You are now even able to open sensitive folders as administrators in Ubuntu.
Karim Buzdar
About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn
Источник
How to open a folder in linux via terminal? [closed]
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago .
How can I open a folder in a dir?
say I change my current directory to: cd /root/dir/
then I list all the files there: ls folder1 folder2 folder3
Now I want to open folder1. If I try the «./» I get: ./folder1 bash: ./folder1: Is a directory
How can I do so without having to type cd again ie: cd $(pdw)/folder1
5 Answers 5
If you want to open the folder via the nautilus file manager, you can move to the wanted directory like you’ve mentioned cd /root/dir/ , check the folders under that path using ls and then if you want to open folder1 type:
./ is used to execute file (Not to open directory).
(In)CLI Method: You can open folder in terminal by cd folder1 or dir folder1 or ls folder1 .
(To)GUI Method: If you want to open with file-manager (ex:nautilus) then type nautilus folder1 (for Ubuntu nautilus is default file-manager)
I have found that simply typing gnome-open «any-oject» opens any folder or file in the default program on Ubuntu. If this happens to be a folder, it uses your default folder-explorer 🙂
zsh shell can do that with the AUTO_CD option.
Just put setopt AUTO_CD in your .zshrc file (start zsh one time first to create the zsh environment files). You can invoke directly zsh at the terminal prompt to start a zsh session or you can change your default shell to be zsh with the chsh command.
Btw this is not a strange feature, crossable directories do have the «execute» attribute so it makes sense to able to execute a directory like any standard commands.
Источник
Opening current directory from a terminal onto a file browser?
My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to reach it. This is very time consuming. On the other hand, with very few key strokes and several times hitting the tab button, it is very easily reachable via a terminal.
I want to know if there is a way to open the current directory in a terminal onto a a file browser. What is the command to do this?
For reference, I have an ubuntu system, but I’d like to know what the commands are across the various distributions of linux.
4 Answers 4
xdg-open is part of the xdg-utils package, which is commonly installed by default in many distributions (including Ubuntu). It is designed to work for multiple desktop environments, calling the default handler for the file type in your desktop environment.
You can pass a directory, file, or URL, and it will open the proper program for that parameter. For example, on my KDE system:
- xdg-open . opens the current directory in the Dolphin file manager
- xdg-open foo.txt opens foo.txt in emacsclient, which I’ve configured to be the default handler for .txt files
- xdg-open http://www.google.com/ opens google.com in my default web browser
The application opens as a separate window, and you’ll get a prompt back in your terminal and can issue other commands or close your terminal without affecting your new GUI window.
I usually get a bunch of error message printed to stderr , but I just ignore them.
Edit:
Adding the arguments xdg-open . >/dev/null 2>&1 redirects the errors and the output. This call won’t block your terminal. Binding this to an alias like filemanager=’xdg-open . >/dev/null 2>&1′ can come in handy.
Almost any GUI application (on X window systems) can be opened from a terminal window within that GUI. To open any GUI app, type the name of the executable at the shell prompt. Most file browsers take a directory as a command line argument, so you should usually pass . as the parameter.
Here are some examples for some popular systems, most X based systems work similarly.
On Gnome, you can run nautilus (the default file browser) directly, or on Gnome 2, you can use gnome-open to open any file (including directories) with the configured Gnome file handler application:
On KDE, there are two popular file browsers, I’m not aware of a command similar to gnome-open , though gnome-open can be executed within KDE, but by default it opens Gnome apps.
On OS X, as mentioned in comments, a similar command line program, open can be used.
What if you don’t know the executable name of your system’s file browser?
If on Gnome 2, use gnome-open . If on OS X, call open . . Each of these will execute the configured file browser for your GUI environment.
If you don’t know of such a command in your window system, here’s one way to find out on systems with a ps command that understands the options -u USER and -o FORMAT :
- In your terminal window, type ps -u$USER -o comm > /tmp/$$A
- In your GUI, start the file browser.
- Back in your terminal window, type ps -u $USER -o comm > /tmp/$$B (Notice the B suffix, this is a different file than step 1).
- Also in the terminal, type diff /tmp/$$[AB] .
Should display the name of your file browser. It’s possible you could see more than one name, if another program happened to start under your user id during the time between the calls to ps .
Источник
How to open and close directories in the Linux terminal | Opensource.com
Learn how to use the cd command to change directories with this Linux tutorial.
CC BY-SA Seth Kenlon
Subscribe now
Get the highlights in your inbox every week.
To open a directory on a computer with a graphical interface, you double-click on a folder. It opens, and you are now «in» that folder.
To open a directory in a terminal, you use the cd command to change your current directory. This essentially opens that folder and places you in it.
Close a folder
To close a directory on a computer with a graphical interface, you close the window representing that directory.
You don’t have to close directories in a terminal, but you can always navigate away from a location you’ve made your current directory. The cd command, issued alone with no arguments, takes you back home.
Topics
About the author
Recommended reading
1 Comment, Register or Log in to post a comment.
It’s also helpful to know the shorthand for moving up in the directory structure.
cd ../
takes you up one level,
cd ../../
takes you up two levels, and so on.
Subscribe to our weekly newsletter
Get the highlights in your inbox every week.
Footer
For more discussion on open source and the role of the CIO in the enterprise, join us at The EnterprisersProject.com.
The opinions expressed on this website are those of each author, not of the author’s employer or of Red Hat.
Источник