diff --git a/crates/nu-command/src/filesystem/cd.rs b/crates/nu-command/src/filesystem/cd.rs index ba91e6d0ca..87071d2888 100644 --- a/crates/nu-command/src/filesystem/cd.rs +++ b/crates/nu-command/src/filesystem/cd.rs @@ -134,7 +134,7 @@ impl Command for Cd { result: None, }, Example { - description: "Change to the previous working directory ($OLDPWD)", + description: r#"Change to the previous working directory (same as "cd $env.OLDPWD")"#, example: r#"cd -"#, result: None, }, @@ -143,6 +143,16 @@ impl Command for Cd { example: r#"def --env gohome [] { cd ~ }"#, result: None, }, + Example { + description: "Move two directories up in the tree (the parent directory's parent). Additional dots can be added for additional levels.", + example: r#"cd ..."#, + result: None, + }, + Example { + description: "The cd command itself is often optional. Simply entering a path to a directory will cd to it.", + example: r#"/home"#, + result: None, + }, ] } } diff --git a/crates/nu-command/src/filesystem/ucp.rs b/crates/nu-command/src/filesystem/ucp.rs index 447751220d..6077278c18 100644 --- a/crates/nu-command/src/filesystem/ucp.rs +++ b/crates/nu-command/src/filesystem/ucp.rs @@ -86,17 +86,22 @@ impl Command for UCp { }, Example { description: "Copy only if source file is newer than target file", - example: "cp -u a b", + example: "cp -u myfile newfile", result: None, }, Example { description: "Copy file preserving mode and timestamps attributes", - example: "cp --preserve [ mode timestamps ] a b", + example: "cp --preserve [ mode timestamps ] myfile newfile", result: None, }, Example { description: "Copy file erasing all attributes", - example: "cp --preserve [] a b", + example: "cp --preserve [] myfile newfile", + result: None, + }, + Example { + description: "Copy file to a directory three levels above its current location", + example: "cp myfile ....", result: None, }, ] diff --git a/crates/nu-command/src/filesystem/umv.rs b/crates/nu-command/src/filesystem/umv.rs index 12d95e015b..9f68a6697f 100644 --- a/crates/nu-command/src/filesystem/umv.rs +++ b/crates/nu-command/src/filesystem/umv.rs @@ -40,6 +40,11 @@ impl Command for UMv { example: "mv *.txt my/subdirectory", result: None, }, + Example { + description: r#"Move a file into the "my" directory two levels up in the directory tree"#, + example: "mv test.txt .../my/", + result: None, + }, ] }