How to move one folder back in Putty - putty

I'm new to Putty and I have installed this on Windows.
I need to move one folder back (one folder upper) from current directory.
I tried cd.. and cd... but didn't work out.
So how to move one folder back from this directory to an upper folder ?

if you want to go to an upper directory use this command :
cd ..

Related

How to move up multiple folder

Using VS Code terminal, a certain directory keeps popping up as default :
C:\Users\user\name\folder1\folder2\folder3\folder4
How do move back up with one single command instead of doing multiple "cd ../.."
Much appreciated!
Sorry I am answering for CMD as it was tagged CMD, I'm not sure how this affects VSCode. So, I'm not sure if I should just delete this or if it is actually relevant. Please let me know.
What folder do you want to go to?
Using your Example C:\Users\user\name\folder1\folder2\folder3\folder4
If you would like to go to the root CD \ will do.
If you would like to go up 4 directories CD ..\..\..\.. will do
If you want to go up 4 directories and back down 3 CD ..\..\..\..\folder1\folder2\folder3
If you want to always go to a specific directory on the current disk CD \Path\to\directory
If you want to always go to a specific folder on another disk CD /D DriveLetter:\Path\To\Folder (eg CD /D X:\Path\To\Folder)
In VScode, add the exact folder in Workspace, you want to open terminal from.

CMD move files without knowing folder name

I'm using Windows CMD via an ANT Build file to move files from a sub-folder into a parent folder that is three levels up. The structure looks like this:
containingFolder
-tempFolder
-unkownNamedFolder
-contents.xyz
Using linux I can do this with the command mv */*.* .. with the current working directory being the temp folder. I don't know what the unknownNamedFolder will be called, but I do know that it will always be the only folder within the temp folder and that whatever content is within it needs to be extracted out to the containingFolder so that temp can be deleted and only the files will remain.
I've tried a command such as /c move *\*.* .. 2>NUL but this doesn't work.

Issue with win cmd finding folders

I am having an issue with the windows cmd line. When I cd into my Users dir my user folder shows as there but I cannot cd into. The path cd\Users\gmenfan83\ is my desired location. However, when I am in the Users dir and cd\Users\gmenfan83 \ I get a "The path is not found or specified" . I am more of a nix user but if the folder shows in the directory tree shouldn't I be able to cd into it? Thank you
Are you trying to use cd/Users/gmenfan83 while you have already used cd/Users? In that case you will not be able to find the file since you are already in the Users folder. Typing cd \Users\gmenfan83 right after opening cmd with C drive path should get you there.
It's unclear (even after your edit) what specifically you're doing, but this should get you started.
If you're currently in C:\users, and you want to change into the C:\Users\gmenfan83 folder, all you need is cd gmenfan83. If you're in C:\, all you need is cd users\gmenfan83.
Relative paths also work in Windows cmd.exe just as they do under *nix. To change from C:\users\gmenfan83\test to C:\users\gmenfan83\temp, you can use cd ..\temp, or specify cd \users\gmenfan83\temp.

Remove one level in the middle of a folder tree

I'm using Windows 7 and would like to remove a middle level of a folder tree while maintaining the files inside those folders. For example:
C:\folder1\folder2\files
I want to remove "folder2" and keep "files".
Open a command prompt, and type:
MOVE c:\folder1\folder2\*.* c:\folder1
RMDIR c:\folder1\folder2

GetSaveFileName() not returning path of CD burning staging area on XP

I have a feature where I save a file to a location that user specifies. I'm using GetSaveFileName() to show the Save As dialog. I then use the path that it returns to write out the file to that location. I've noticed that it does not work when the user chooses the CD-RW drive on an XP machine. This same process works correctly on Vista and Windows 7. I've made the following observations:
The path returned by GetSaveFileName() returns the path of the temporary staging area when choosing the CD burner root folder (F: in my case) on Win7/Vista.
On XP, choosing the CD burner root folder just returns F:\ as the path. HOWEVER, if I create a sub folder using the Save As dialog and save the file in this folder (e.g. F:\folder), the path is that of the temporary folder.
Using another application such as Notepad in XP will correctly redirect to the temp folder for F:\ .
So the problem only exists when saving to the root folder of the CD burner on XP. How can I achieve the same functionality as Notepad in XP and have Save As redirect to the temp folder so I have have a path I can write to for CreateFile()?
I think the fact that you get back the CD staging area for some paths is a "by-product" of the way the IShellFolder::GetDisplayNameOf function works. I've found that for CD burners, a PIDL for a file or folder that only exists in the staging area, will convert to a string referencing the staging area. A PIDL for a file or folder that exists on the CD (whether or not it exists in the staging area as well) will convert to a string referencing the CD. Because the root folder (by definition) exists on the CD, it's the CD path you get back as a string.
I would suggest handling this yourself. You can use the ICDBurn::GetRecorderDriveLetter function to get the recorder's drive letter - then it's trivial to compare against the string you get back from GetSaveFileName(). If you do get back a path on the CD burner, you can use SHGetFolderLocation with CSIDL_CDBURN_AREA to get the path of the staging area - then it's simply a matter of replacing the drive letter at the beginning of the path string with the path of the staging area.

Resources